Code: Select all
<p:dataTable id="example" var="item"
value="#{controller.itemList}" selectionMode="single"
selection="#{controller.selectedItem}"
rowKey="#{item.id}" scrollable="true" scrollWidth="100%"
scrollHeight="100%" paginator="true"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
rowsPerPageTemplate="5,10,15" rows="10" paginatorPosition="bottom">
<p:column headerText="Title" sortBy="#{item.title}">
<h:outputText value="#{item.title}" />
</p:column>
<p:column headerText="name" sortBy="#{item.firstname} #{item.lastname}">
<h:outputText value="#{item.firstname} #{item.lastname}" />
</p:column>
<f:facet name="paginatorBottomLeft">
<h:outputLabel value="#{controller.itemList.size()} items found" />
</f:facet>
<p:ajax event="rowSelect" update=":mainform:editDialog :mainform:editButton :mainform:deleteButton" />
</p:dataTable>
Code: Select all
<p:cache region="menuCache" key="dttableContacts">
<p:dataTable id="example"
...
</p:dataTable>
</p:cache>
Primefaces 6.2
EHCache 2.10.5
Jboss EAP 7.0
Java 1.8