0 Replies Latest reply on Jul 20, 2007 4:02 AM by orribl

    Problem with HtmlDatascroller and setPageIndex

      Hi,

      I have a problem when I want to set the pageIndex of a HtmlDataScroller:
      three componente:
      <h:selectOneRadio> AjaxEnabled with <a4j:support event="onclick"/>
      <rich:dataTable>
      <rich:datascroller>
      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:

      JSP:

      <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}"/>
      </h:selectOneRadio>
      ....
      <rich:dataTable rows="#{mseBackingBean.numberOfVisibleRows}" id="mseItems" styleClass="mse_items" rowClasses="heading" value="#{mseBackingBean.mseItems}" var="item">
      ....
      </rich:dataTable>
      ....
      <rich:datascroller binding="#{mseBackingBean.dataScroller}" align="left" id="dsMseItems" for="mseItems" maxPages="20" ignoreDupResponses="true" />
      </rich:datascroller>


      BackingBean
      private HtmlDatascroller dataScroller;
      ...
      public void mseItemsVisibilityChanged(){
       this.dataScroller.setPageIndex(2);
       this.dataScroller.getPageIndex();
      }