5 Replies Latest reply on Jun 28, 2007 12:23 PM by Todd Main

    InputText value being cached

    Todd Main Newbie

      I have an "edit" form with an "h:inputText" component whose value comes from a bean.

      If I change the input value, cancel the edit and load the edit page again, I'm still seeing the modified value.

      I confirmed that the actual object that is outjected has the correct value from the database. I even added an "outputText" component after the "inputText" component on the page, and the input field has the bogus (modified) value while the text from "outputText" has the correct value.

      This is maddening!!!

      I'm using Seam 1.2.1. Here are some snippets:

      <h:inputText id="name" value="#{rule.name}" />
      <h:outputText value="#{rule.name}" />
      


      @Name("editDocumentRule")
      @Stateful
      @Scope(ScopeType.CONVERSATION)
      public class EditDocumentRuleAction implements EditDocumentRule {
      
       @PersistenceContext
       EntityManager em;
      
       @In(required = false)
       @Out(scope = ScopeType.CONVERSATION)
       DocumentRule rule;
      
       @In(create = true)
       DocumentRuleManager documentRuleMgr;
      
       @RequestParameter(value = "id")
       private Integer ruleId;
      
       @Begin(join = false, flushMode=FlushModeType.MANUAL)
       public String edit() {
      
       setRule(documentRuleMgr.getDocumentRule(em, getRuleId()));
      
       return "/jsf/rules/EditDocumentRule.xhtml";
       }
      
       @End
       @Rollback
       public String cancel() {
       em.refresh(rule);
       rule.setDoneEditing(true);
       return "/jsf/rules/EditDocumentRule.xhtml";
       }
      
       @End
       public String save() {
       rule.setDoneEditing(true);
       em.merge(rule);
       em.flush();
       return "/jsf/rules/EditDocumentRule.xhtml";
       }