5 Replies Latest reply on Feb 28, 2008 5:50 AM by Sietse de Kaper

    Conditional field render does not submit or validate

    Sietse de Kaper Newbie

      Hi, maybe this should be in the Seam forum, but I think it's more a4j related. I have the following code:

      <a4j:outputPanel style="block" id="sectionContent">
       <a4j:form id="form" ajaxSubmit="true">
       <s:validateAll>
      
       <h:selectBooleanCheckbox id="mailCheckbox" value="#{showMail}">
       <a4j:support event="onchange" reRender="sectionContent" />
       </h:selectBooleanCheckbox>
       <h:outputLabel value="E-mail" for="mailCheckbox" />
      
       <s:fragment rendered="#{showMail}" >
       <s:decorate>
       <h:outputLabel value="adres: " for="emailAddress" />
       </s:decorate>
      
       <s:decorate>
       <h:inputText id="emailAddress" value="#{notificationWizard.emailAddress}" required="true"/>
       </s:decorate>
       </s:fragment>
      
       </s:validateAll>
       <a4j:commandButton action="#{notificationWizard.save}" value="Save" reRender="sectionContent"/>
       </a4j:form>
      </a4j:outputPanel>
      


      I'm trying to give the user the choice to input this particular field or not. I thought this would work, but it doesn't. The text field is displayed when the checkbox is checked, and hidden again when it is unchecked, but somehow the value does not get submitted (or validated, for that matter).

      Should this even work? Am I doing something wrong?