0 Replies Latest reply on Aug 3, 2012 3:23 AM by semubiz

    RowCount of rich:dataTable

    semubiz Newbie

      Hi

       

      Im trying to retrieve the row count after applying filters. So far, I'm able to calculate the total row count, but filtered rows are not taken into respect. So the row count is wrong after applying filters.

       

      {code:xml}

      <a4j:outputPanel id="resourceErrorPanel">

      <h:outputText value="#{myBean.dataTable.rowCount}"/>

      </a4j:outputPanel>

       

      <rich:dataTable id="resourceErrorTable" value="#{myBean.resourceErrors}" binding="#{myBean.dataTable}" var="container" rowClasses="odd-row, even-row" rows="100">

      <rich:column filterValue="#{myBean.resourceFilterHelper.selectedOption}" filterExpression="#{myBean.resourceFilterHelper.emptySelection or container.resource == myBean.resourceFilterHelper.selectedOption}">

      <f:facet name="header">

      <h:panelGroup>

      <h:outputText value="Resource"/>

      <h:selectOneMenu value="#{myBean.resourceFilterHelper.selectedOption}">

      <f:selectItem itemValue="#{null}" itemLabel=""  noSelectionOption="true"/>

      <f:selectItems value="#{myBean.resourceFilterHelper.options}" />

      <a4j:ajax render="resourceErrorTable, resourceErrorPanel" execute="@this" event="change" />

      </h:selectOneMenu>

      </h:panelGroup>

      </f:facet>

      <h:outputText value="#{container.resource}"/>

      </rich:column>

      </rich:dataTable>

      <rich:dataScroller for="resourceErrorTable" maxPages="10">

      <f:facet name="first">

      <h:outputText value="First" />

      </f:facet>

      <f:facet name="last">

      <h:outputText value="Last" />

      </f:facet>

      </rich:dataScroller>

      {code}

       

      Where the "dataTable" is an instance of org.richfaces.component.UIDataTable. How can I calculate the row count after filters have been applied?