0 Replies Latest reply on Mar 27, 2008 8:04 AM by Thiagu Mariappan

    browser back button not maintain selections on previous page

    Thiagu Mariappan Novice

      Hi every one

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

      <h:form>
       <h:selectManyCheckbox value="#{home.value}">
       <f:selectItems value="#{brandItems}"/>
       </h:selectManyCheckbox>
      
       <h:commandButton action="#{home.display}" value="Submit" />
      
       <s:link value="view newxt page" action="#{temp.getAll}" view="/table.xhtml" />
      </h:form>
      

      2. This is my session bean code
      @Stateful
      @Name("home")
      public class TempAction implements Temp,Serializable
      {
       private static final long serialVersionUID = 1L;
      
       String []value;
      
       @Out(required=false)
       List<SelectItem> brandItems;
      
       @Begin(join=true)
       public void getAll() {
      
       brandItems=new ArrayList<SelectItem>();
       brandItems.add(new SelectItem("First","First"));
       brandItems.add(new SelectItem("Second","Second"));
       }
      
       public String[] getValue() {
       return value;
       }
      
       public void setValue(String[] value) {
       this.value = value;
       }
      
       public void display() {
       for(String a:value)
       System.out.println("________________"+a);
       }
      
      
       @End
       public void reset() {}
      
       @Destroy
       @Remove
       public void destroy() {}
      
      }
      
      

      3. I invoke getAll method by using following code in my pages.xml

      After visiting the second page by clicking the s:link , I go back to the first page by using browser BACK button . Then when I hit the SUBMIT button, I get the following error message in my jboss console
      and also the check boxs are deselected
      16:29:05,843 INFO [lifecycle] WARNING: FacesMessage(s) have been enqueued, but may not have been displayed.
      sourceId=j_id16:j_id17[severity=(ERROR 2), summary=(value is not valid), detail=(value is not valid)]
      

      Kindly assist to resolve this problem. Many thanks in anticipation.

      By
      Thiagu.m