1 Reply Latest reply on Sep 15, 2010 12:44 AM by traga

    Rich:datatable & datascroller index is not getting reset

    traga

      Hello,

       

      We are using richfaces 3.3.3 and rich:datatable and datascroller are used. When a a4j:commandbutton is clicked, using reRender attribute, the datatable and datascroller are getting rendered. The datascoller is not resetting it's current page number to 1 instead maintaining the previously viewed page number.

       

      My datascroller code in the jsp is as follows:

       

      <rich:dataTable id="searchResultsTable" sortMode="single" width="100%"           var="result" rendered="#{not empty entitySearchBean.searchResults}" value="#{entitySearchBean.searchResults}" binding="#{entitySearchBean.searchResultsDataBinding}" rows="10">

       

      <rich:datascroller for="searchResultsTable" renderIfSingle="false" maxPages="10" page="1"/>

       

      I'm setting the  searchResultsDataBinding.setFirst(0) in my action method.

       

       

      Is there any thing i'm missing to reset the current page in the datascroller or datatable?

       

      - Raga

        • 1. Re: Rich:datatable & datascroller index is not getting reset
          traga

          Hello, the issue is resolved. For datascroller 'page' attribute instead of giving a static value, just bind it with a managed bean attribute and reset it to 1 for every search request.

           

          <rich:datascroller for="searchResultsTable" renderIfSingle="false" maxPages="10" page="#{formBean.curPageIndex}"/>