3 Replies Latest reply on Apr 25, 2008 9:07 AM by Martin Trummer

    Form validation does not dissappear

    Martin Trummer Newbie

      I have the following page (simplified):

      <a4j:form id="personForm">
        <h:selectOneMenu value="person">
          <s:selectItem value=#{allPersons} var="person" label="person.name"/>
          <a4j:support event="onchange" action="#{mb.updatePerson}" reRender="personForm" ajaxSingle="true"/>
        <s:decorate template="editDecoration.xhtml">
          <h:inputText value="person.name" required="true"/>
        <h:inputText id="age" value="person.age" required="true" />
        <h:message for="age" />
        <a4j:commandButton action="mb.savePerson" />

      When I open this page and press the save button, the validation fails because no age and name is given and an error message occurs.
      Now when I use the drop down box to select another person (without submitting the form correctly again) the form gets re rendered but the validation message for the name input field does not dissappear. For the age input field it works.

      How can I hide all validation messages? Within editDecoration.xhtml I use the #{invalid} flag.