title: Reloading the same page based on a toggle button preserving the paramters
body: <p>I have a page where I have a static list containing the list of products which are again grouped into product groups.I have a toggle button in the JSP page which shuffles between the enabled and disabled products .Code for my toggle button is as follows</p>
  
  <pre><code> &lt;h:commandButton value="retrieve"  image="#{displayProductsBean.productsToggleImage}" actionListener="#{displayProductsBean.fetchProductsBasedOnStatus}"&gt;
       &lt;c:choose&gt;
        &lt;c:when test="${displayProductsBean.productFetchCriteria=='0'}"&gt;
          &lt;f:attribute name="buttonSelected" value="1" /&gt;
        &lt;/c:when&gt;
        &lt;c:otherwise&gt;
          &lt;f:attribute name="buttonSelected" value="0" /&gt;
        &lt;/c:otherwise&gt;
      &lt;/c:choose&gt;
  
      &lt;/h:commandButton&gt;
  </code></pre>
  
  <p>Now in the managed bean I am able to get the value of the button selected and have logic to retrieve either enabled or disabled products 
  But I don't know how would I get back to the same page and also I don't want the list to be reloaded again from the DB.Code in my bean class is as follows</p>
  
  <pre><code>public void fetchProductsBasedOnStatus(ActionEvent event)
      {
          System.out.println("The fetchProductsBasedOnStatus in bean is called"); 
          String selected = (String) event.getComponent().getAttributes().get("buttonSelected");
          System.out.println("The value of toggle button is"+selected);
          setProductFetchCriteria(Integer.parseInt(selected));
          System.out.println("The value of toggle button is"+this.toString());
  
      }
  </code></pre>
  
  <p>Somebody please help me resolve this .....</p>