2 Replies Latest reply on Sep 23, 2008 8:38 AM by Thiagu Mariappan

    Data Filter Slider with two data scroller not synchronizes e

    Thiagu Mariappan Novice

      Hi every one.
      I am using the two data scroller in my data table.
      One at the top and another one at the bottom.
      I need to reset the data scroller at the time of filter my data table by using data filter slider
      I meant I need to set the page as 1 for data scroller.
      Here I face the problem is two data scroller are not synchronizes each other at the time of I filter my data table.

      Here is my sample view code.

      <h:form>
      
       <rich:inputNumberSlider minValue="1000" value="#{search.price}" width="200" maxValue="10000" step="1" id="priceslide" >
       <a4j:support event="onchange" actionListener="#{search.filterDataTable}" reRender="sc2,sc1,productList"/>
       </rich:inputNumberSlider>
       <br/>
      
       <rich:datascroller ajaxSingle="false" for=" productList " maxPages="10" page="#{search.scrollerPage}" reRender="sc2" id="sc1" />
      
       <rich:dataTable id=" productList " rows="10" var="record" value="#{searchReasult}">
      
       <rich:column>
       <f:facet name="header">
       <h:outputText value="Product ID"/>
       </f:facet>
       <h:outputText value="#{record.productId}"/>
       </rich:column>
      
       <rich:column>
       <f:facet name="header">
       <h:outputText value="Product Name"/>
       </f:facet>
       <h:outputText value="#{record.productName}"/>
       </rich:column>
      
       </rich:dataTable>
      
      <rich:datascroller for=" productList " maxPages="10" page="#{search.scrollerPage}" id="sc2" reRender="sc1" />
      
       </h:form>
      
      


      This is my session bean class
      @Factory("searchReasult")
      public void selectFromRequest()
      {
      
      searchReasult=em.createQuery("select t from TblProducts t where ").getResultList();
      temp1=new ArrayList<TblProducts>(searchReasult);
      
      
      }
      
      
      public void filterDataTable(ActionEvent event)
       {
       List<TblProducts> temp=new ArrayList<TblProducts>();
       for(TblProducts a:temp1)
       if((price.compareTo(a.getPrice())<=0) )
       temp.add(a);
       searchReasult=temp;
       scrollerPage=1;
       }
      


      please any one help me ..