Datatable : show total rowCount in the ui

UI Components for JSF
Post Reply
hgu
Posts: 18
Joined: 06 Jun 2011, 11:25

11 Jun 2011, 12:44

Hello,

When using datatable with lazy and paginator options, i am trying to show the total rowcount to user but this value is not updated after filtering for example. For example the paginatorTemplate allows to know total number of pages but I don't see an attribute allowing to know the rowCount updated after filtering.

Here is my code
<p:dataTable id="myTable" var="user" value="#{userSearchBean.userModel}"
lazy="true" paginator="true" rows="3" emptyMessage="Pas de données"
paginatorTemplate="{FirstPageLink} {PreviousPageLink} {CurrentPageReport} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" rowsPerPageTemplate="3,5,10"
>

<f:facet name="header">
Liste des utilisateurs
</f:facet>
<p:column sortBy="#{user.name}" filterBy="#{user.name}" >
<f:facet name="header">
Nom
</f:facet>
<h:outputText value="#{user.name}"/>
</p:column>
</p:dataTable>

<h:outputLabel id="totalNumber" value="#{userSearchBean.totalResultNumber}"/>
The variable totalResultNumber is not updated when filtering. Is there a way to update it after the filter ajax request?
Thanks for your answer
Primefaces 5.2 / Mojarra 2.2.8 / Glassfish 3.2.1.1 / Tomcat 7.0.61 / NetBeans 8.0.1

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 58 guests