0 Replies Latest reply on Apr 10, 2009 12:04 AM by Arbi Sookazian

    HtmlInputHidden with Seam read-only text fields

    Arbi Sookazian Master

      I have a use case in which the text field is read-only but the field may be originally blank and then auto-populated by a selection in a modalPanel.  That value needs to be persisted to DB.

      So what is the best practice to handle this scenario in Seam?

      I did a quick POC for this and learned that the readonly="true" attribute for h:inputText effectively blocks the update model values JSF phase from firing.

      This is what I have that works for now:

      <h:outputText id="string0"
      <h:inputHidden id="string1" value="#{testInputTextReadOnly.testString1}" />

      Old skool JSP style.  So the HtmlInputHidden value is being modified by a javascript function (in my POC xhtml) and that new value is being passed as the argument to the setter method in the backing bean.  So all's good.

      I didn't find any mention of this topic in the Seam ref doc or Seam in Action...