0 Replies Latest reply on Sep 11, 2007 6:14 AM by Thiagu Mariappan

    inputNumberSlider  instead of dataFilterSlider

    Thiagu Mariappan Novice

      Hai everyone

      this is my Database structure

      id product price
      1 cell 2000
      2 tv 5000
      3 dvd 4000

      i need to display this information in a table format , with dual slider. but Richface not have dual slider so we planed to use two FilterSlider. one for minimum price and another for maximum price.

      but i cant use two dataFilterSlider within single page

      i am using seam 2.0.0 Beata1


      so i planed to use use inputNumberSlider instead of dataFilterSlider
      but i have some issues , so any one help me
      this is my view part

      <a4j:form id="form1" reRender="table-body,maxprice" ajaxSubmit="true" ignoreDupResponses="true" requestDelay="500">
      <a4j:region id="stat1">
      <h:panelGrid columns="2" >
       <rich:inputNumberSlider minValue="1000" value="#{productsearch.mini}" width="200" maxValue="10000" step="500" id="minprice" onclick="submit()"/>
       <rich:inputNumberSlider minValue="1000" value="#{productsearch.maxi}" width="200" maxValue="10000" step="500" id="maxprice" onclick="submit()"/>
       <rich:spacer height="20" width="283" />
      <a4j:outputPanel id="table-body">
      <rich:dataTable id="prodList" value="#{product}" var="row">
       <f:facet name="header">
       <h:outputText value="product " />
       <h:outputText value="price" />
       <h:selectBooleanCheckbox value="#{row.product}"/>
       <h:outputText value="#{row.price}" />

      and this is my session bean class
      public class ProductsAction implements ProductsLocal,
      BigDecimal mini= null;
      BigDecimal maxi=null;
      TblProducts<TblProducts > pro;
      ArrayList<TblProducts > temp;
      EntityManager em;
      public String displayProducts()
      pro=em.createQuery("select t from TblProducts t").getResultList();
      temp=new ArrayList(pro);
      return "go";
      public BigDecimal getMini() {
      return mini;
      public void setMini(BigDecimal mini) {
      this.mini = mini;
      ArrayList<TblProducts> temp1=new ArrayList<TblProducts>();
       for(TblProducts a:temp)
       if((mini.compareTo(a.getPrice())<=0) && (maxi.compareTo(a.getPrice())>=0)) )
      public BigDecimal getMaxi() {
       return maxi;
      public void setMaxi(BigDecimal maxi) {
       this.maxi = maxi;
       this.maxi=this.mini.add(new BigDecimal(500));

      this is our code its works fine.

      but our issue is we but onclick="submit()" event to inputNumberSlider ,
      so user click anywhere on the slider it filters the dataTable

      but if the user slides the filter pointer rashly out of the boundary, then the onclick function is not completing and its not working.

      we cant use onchange="submit()" event to inputNumberSlider , because it won't submit the form

      so how to resolve this problem
      any one help me