4 Replies Latest reply on Jul 22, 2008 6:38 AM by Ilya Shaikovsky

    datascroller not working if the table grow bigger

    vivian hu Novice

      we have a table with a datascroller and a control to show more data. It works fine when it first show up.
      For example, the table originally have 2 pages, the scroller shows 2 pages and you can use > button to go to the second page. But if we click on "more data", and reRender the table and the scroller, now the scroller shows 4 pages correctly, but when you click on the > button to navigate through the pages, you can only go to the second page, you can't reach the third page, clicking on the > button gave no response.
      I think this has something to do with the JSF life cycle, the info about 4 page is not available early enough for the scroller to pick up. Is it true? How to solve this problem?

        • 1. Re: datascroller not working if the table grow bigger
          shashi kumar Newbie


          This datascroller should be inside <h:form /> tag....


          <rich:dataTable id="listingValues" style="text-align:center;" var="employee" rows="5"
          value="#{employees.resultList}"rendered="#{not empty employees.resultList}">


          <rich:datascroller align="right" for="listingValues" maxPages="2"
          page="#{dataTableScrollerBean.scrollerPage}" reRender="sc2" id="sc1" />


          The field for="listingValues" in the datascroller is mapped with the datatable id (id="listingValues")

          employees.resultList list from the database.

          I think this will help.... you....
          shashi

          • 2. Re: datascroller not working if the table grow bigger
            vivian hu Novice

            Thanks for the response. I have done what you mentioned already. If the table initially shows 10 pages, and later shows 5 pages, everything works fine. But if the table original show 10 pages, and later show 12 pages, the last 2 pages cannot be navigated to by the next button in the scroller (but the scroller does show there are 12 pages total).

            • 3. Re: datascroller not working if the table grow bigger
              shashi kumar Newbie

              <rich:dataTable id="employeeListId" style="text-align:center;" var="employee"
              rows="5" value="#{employeeList.resultList}"
              rendered="#{not empty employeeList.resultList}">


              In data table rows=5 is used to define number of recors to diaplay... per page...

              <rich:panel>
              <rich:dataTable>

              <h:output value=#{employee.name}/>
              ...
              ....
              ...

              </rich:dataTable>
              </rich:panel>
              <rich:datascroller align="right"
              for="employeeListId" maxPages="2"
              page="#{dataTableScrollerBean.scrollerPage}" reRender="sc2" id="sc1" />


              The datascroller sholud be placed like this...
              Try this one...
              Please check the mapping is done properly.....


              shashi

              • 4. Re: datascroller not working if the table grow bigger
                Ilya Shaikovsky Master

                Also please show your RF version. In latest 3.2.1 GA - datascroller was improved and I highly recommend you to use it.