From the PrimeFaces 3.5 DataTable
source code:
210 public java.lang.String getEmptyMessage() {
211 return (java.lang.String) getStateHelper().eval(PropertyKeys.emptyMessage, "No records found.");
212 }
So, it's hard coded and there's no way to change it in a single place other way than hacking the PrimeFaces source or creating a tagfile (not composite!) <my:dataTable>
which wraps the <p:dataTable>
with the desired message set.
<ui:composition ...>
<p:dataTable id="#{id}" value="#{value}" var="item"
emptyMessage="#{messages['general.message.EmptyList']}">
<ui:insert />
</p:dataTable>
</ui:composition>
<my:dataTable id="foo" value="#{bean.items}">
<p:column>#{item.foo}</p:column>
<p:column>#{item.bar}</p:column>
</my:dataTable>
If you actually don't want to change the message, but merely want to hide it altogether, then you could also opt for a pure CSS solution:
.ui-datatable-empty-message {
display: none;
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…