1 Reply Latest reply on Apr 5, 2008 10:43 PM by Jacob Orshalick

    Browse back button issue

    Thiagu Mariappan Novice

      Hi every one

      i have the same problem what they discussed here

      My Link

      i try the workaround code , but i cant fix the problem
      this is what i am try .

      1. The following is my code for a home page.

      <body onload="reloadAjaxPanels()">
      <a4j:form id="form">
           <a4j:jsFunction name="reloadAjaxPanels" reRender="panelToReload" />
           <a4j:outputPanel id="panelToReload">
           <h:selectManyCheckbox id="Brand"  value="#{search.brand}"  >
           <f:selectItems value="#{brandItems}"/>
           <a4j:support event="onclick" reRender="form"/>
           <rich:dataTable rows="10" id="ver" value="#{prodlis}" var="category">          
                     <f:facet name="header">     
                     <h:outputText styleClass="headerText" value="Product Name" />
                     <h:outputText value="#{category.productName}" />
                     <f:facet name="header">     
                     <h:outputText styleClass="headerText" value="Brand" />
                     <h:outputText value="#{category.brand}" />
           <rich:datascroller ajaxSingle="false" for="ver" maxPages="4" />

      2. This is my session bean code

      package session.beans;
      import static org.jboss.seam.ScopeType.CONVERSATION;
      import java.io.Serializable;
      import java.math.BigDecimal;
      import java.util.ArrayList;
      import java.util.LinkedList;
      import java.util.List;
      import javax.ejb.Remove;
      import javax.ejb.Stateful;
      import javax.faces.model.SelectItem;
      import javax.persistence.EntityManager;
      import org.jboss.seam.annotations.Begin;
      import org.jboss.seam.annotations.Destroy;
      import org.jboss.seam.annotations.End;
      import org.jboss.seam.annotations.In;
      import org.jboss.seam.annotations.Name;
      import org.jboss.seam.annotations.Out;
      import org.jboss.seam.annotations.web.RequestParameter;
      import entity.beans.TblProducts;
      public class homeAction implements Home, Serializable{
           @In EntityManager entityManager;
           BigDecimal hid;
               List<TblProducts> prodlis;     
               List<TblProducts> temp;
               List<SelectItem> brandItems;
               String []brand;
          public void ProductsList() 
                brandItems=new LinkedList<SelectItem>(); 
                prodlis= entityManager.createQuery("select  b from TblProducts b where b.subcategoryId="+hid).getResultList();
                temp=new ArrayList<TblProducts>(prodlis);
           List<String>  filter= entityManager.createQuery("select  distinct(t.brand) from TblProducts t where t.subcategoryId="+hid).getResultList();
                 for(String a:filter) 
                brandItems.add(new SelectItem(a,a));
           public String[] getBrand() {
                return brand;
           public void setBrand(String[] brand) {
                this.brand = brand;     
                List<TblProducts> temp1=new ArrayList<TblProducts>();
                     for(String a:brand)
                          for(TblProducts b:temp)
           public void reset() {
                // TODO Auto-generated method stub          
           public void destroy() {
                // TODO Auto-generated method stub          

      this code for data table filter ,
      if any one click the particular brand i need to filter the data table records with the brands.

      i have the problem with IE back button .
      after filter particular brand , then i visit some other page , then i hit back button of the browser , i check box selection will be deselected , and also my data table shows all the products .

      i need to maintain the previous filter stage .
      How to do that.