8 Replies Latest reply on Apr 13, 2010 10:02 AM by sburgula1

    dataSrcoller, how to send page number to backing bean

    dkane

      Hello.

      Trying to bind datascroller page index to backing bean.

      <rich:datascroller for="userTbl" pageIndexVar="pageIndex">
       <a:actionparam name="pIndex" value="#{pageIndex}" assignTo="#{userAdmin.pageIndex}"/>
      </rich:datascroller>
      


      Backing component :

      int pageIndex;
      
       public String getPageIndex()
       {
       return String.valueOf(pageIndex);
       }
      
       public void setPageIndex(String p)
       {
       log.info("Page index set to "+p,null);
       try
       {
       this.pageIndex=Integer.valueOf(p);
       }
       catch(Exception ex)
       {
       this.pageIndex=1 ;
       }
      
       }
      



      When I switch pages, the log message is always "Page index set to null".
      Tried to access pageIndex as integer not string, the result was "must be a number".

      What is the correct way to get page index ?
      Thanks