1 Reply Latest reply on Jan 22, 2012 6:42 PM by Wade Love

    Return a rich:dataTable with dataScroller to page one

    Wade Love Newbie



      The environment is RichFaces 4.1 on a Tomcat 6.0.

      Here is what I have code-wise at the moment:






              <!-- a few f:selectItem here -->

              <a4j:ajax event="selectitem" render="tablePanel" />   


          <br /><br />


          <h:panelGroup id="tablePanel">

                  <rich:dataTable id="standardTable" binding="#{standardBacker.standardTable}"

                  value="#{standardBacker.curRank.standardsList}" var="stdrd" rows="8">



                      <f:facet name="header">Id</f:facet>

                      <h:outputText value="#{stdrd.idNum}" />


                <!-- additional rich:column here -->


                  <f:facet name="footer">

                      <rich:dataScroller id="standardScroller" binding="#{standardBacker.standardScroller}" />









      And here is the value change listener method in StandardBacker.java:


           public void rankChange(ValueChangeEvent evt) {

                // get data from the data base happens here





           // other elements and the binding UI components with getters and setters not shown.


      The desired result is that each time the user makes a change to the select, a new set of data is fetched and displayed in the table, with the table at page one.  The actual result is that the user can make one selection, page through it, then make another selection, and the table returns at whatever page number the user had been on previously.  If the new result set has fewer pages, it goes to the last page.


      I've tried other variations on what I've copied here, but all with the same outcome: the table does not go to page one after a new selection.


      Please advise on the correct approach.