5 Replies Latest reply on May 24, 2012 12:12 PM by multanis

    DataScroller  - change displayed rows numbers - below table

    multanis

      Hi,

       

      I'm trying to have datascroller with dynamic rows number, but it works only if my dataScroller is above my table.

      Basically, what I have is:

       

       

      <h:selectOneMenu value="#{myBean.batchRows}">
           <f:selectItem itemLabel="10" itemValue="10"/>
           <f:selectItem itemLabel="20" itemValue="20"/>
           <f:ajax render="table table-ds" />
      </h:selectOneMenu>
      ...
       <rich:dataTable id="table" rows="#{myBean.batchRows}" value="#{myBean.dataModel}" var="var">
      ...
      </rich:dataTable>
      
      <rich:dataScroller id="table-ds" page="#{myBean.batchPage}" for="table" renderIfSinglePage="false" boundaryControls="hide" fastControls="hide">
      ...
      </rich:dataScroller>
      

       

      And the behaviour with 21 elements:

      - on page 2 displaying 20 element (so only 1 is visible), if I switch to 10, I stay on page 2 but I still have only 1 element visible.

       

      If my datascroller is above my table it works fine.

       

      Debugging a bit, it seems that when UIDataAdaptor.walk method is 1st called, getComponentState() is updating the state rows and first properties with values:

      - rows: 10 (correct)

      - first: 20 (weird)

       

      Following calls to this method is setting those properties to:

      - rows: 10 (correct)

      - first: 10 (correct)

       

      I'm using richfaces 4.2.1.Final

       

      Is this a bug ? Should I fill it in Jira ? Is there any workaround ?

       

      Thanks a lot !