0 Replies Latest reply on Sep 5, 2007 11:48 AM by Florian Duehring

    Problem with DataScroller - setPageIndex

    Florian Duehring Newbie

      I have a problem when I want to set the pageIndex of a HtmlDataScroller:
      three components:

      <h:selectOneRadio> AjaxEnabled with <a4j:support event="onclick"/>

      When I click a radio button, an ajax event is fired and this affects the number of data elements in the dataTable. After that event is handled I reRender the dataTable and the dataScroller.
      In the event handler I want to set the pageIndex of the dataScroller to the first page. Therefore I have a HtmlDatascroller-object in my backing bean wich is bind to the datascroller in the jsp-page (binding-attribute).
      I used the setPageIndex-Method of this object to set the page index. It works fine when set the page index to 1 or 2 (which meens page 2 or 3), but when I want to set the pageIndex to 0 nothing happens.
      Any Idea?
      I use Ajax4JSF 1.1.1, RichFaces 3.0.1, MyFaces 1.2.0

      Here are some code snippets:


      <h:selectOneRadio id="mseItemsVisibility" value="#{mseBackingBean.mseItemsVisibility}" >
       <f:selectItem itemLabel="#{msg.show_all}" id="item1" itemValue="SHOW_ALL" />
       <f:selectItem itemLabel="#{msg.show_not_edited}" id="item2" itemValue="SHOW_NOT_EDITED"/>
       <f:selectItem itemLabel="#{msg.show_edited}" id="item3" itemValue="SHOW_EDITED" />
       <a4j:support ajaxSingle="true" event="onclick" reRender="mseItems,dsMseItems,dsMseItemsText" ignoreDupResponses="true" action="#{mseBackingBean.mseItemsVisibilityChanged}"/>
      <rich:dataTable rows="#{mseBackingBean.numberOfVisibleRows}" id="mseItems" styleClass="mse_items" rowClasses="heading" value="#{mseBackingBean.mseItems}" var="item">
      <rich:datascroller binding="#{mseBackingBean.dataScroller}" align="left" id="dsMseItems" for="mseItems" maxPages="20" ignoreDupResponses="true" />

      private HtmlDatascroller dataScroller;
      public void mseItemsVisibilityChanged(){