0 Replies Latest reply on Apr 27, 2011 3:02 AM by Thomas Buckley

    Find DataScroller current page

    Thomas Buckley Newbie

      Hi

      I'm using a dataTable with a dataScroller. I've added the 'Page' atribute to my dataScroller and put getter and Setters in the bean.

      How can I check the current page a user is on in the bean?

      Do I have to manually maintain the backing bean value each time a user selects a new page, hits next, previous, etc?

       

      <a4j:outputPanel id="renderArea">

          <rich:dataTable id="testTable" rows="5" value="#{testBean.myList}" var="item">

              ....

          </rich:dataTable>

      </a4j:outputPanel>

       

       

      <!--- Get called when clicking on button inside renderArea --->

      <a4j:commandButton id="HIDDENRERENDER"  reRender="renderArea,PTScroll" value="+test"  style="display:none"/>

       

       

      <a4j:outputPanel id="PTScroll">

          <h:panelGrid>

              <rich:datascroller  for="testTable" maxPages="20" renderIfSinglePage="false" page="#{testBean.myPage}" />

          </h:panelGrid>

      </a4j:outputPanel>

       

       

       

       

      public class testBean

      {

          private int myPage = 1;

       

       

          public void initialise()

          {

              this.setMyPage(0);

          }

       

       

          public int getMyPage()

          {

              return myPage;

          }

       

       

          public void setMyPage(int page)

          {

              this.myPage = page;

          }

       

       

      }

       

       

      Thanks