1 Reply Latest reply on Oct 1, 2008 6:43 AM by ilya_shaikovsky

    actionListener start to work when there are no error message

    cocolino

      This is part of my registration page:

      <a4j:form>
      <h:panelGrid columns="2" cellpadding="3" cellspacing="3">
      
      <h:outputLabel for="name" value="#{msg['register.name']}"/>
       <h:panelGroup>
       <h:inputText id="name" value="#{registrationBean.user.name}" maxlength="50" required="true"/>
       <rich:message for="name">
       <f:facet name="passedMarker">
       <h:graphicImage value="/images/passed.gif" styleClass="richMsg"/>
       </f:facet>
       <f:facet name="errorMarker">
       <h:graphicImage value="/images/error.gif" styleClass="richMsg"/>
       </f:facet>
       </rich:message>
       </h:panelGroup>
      
      <h:panelGroup/>
       <h:panelGroup>
       <a4j:commandButton type="submit" value="#{msg['register.submit']}" action="#{registrationBean.register}" actionListener="#{registrationBean.submitPressed}"/>
       <a4j:commandButton type="reset" value="#{msg['register.reset']}" immediate="true"/>
       </h:panelGroup>
      
      
      </h:panelGrid>
      </a4j:form>
      


      Part of my form is checked by validators and part in bean (comparing two fields). Validation in bean is made when all fields are ok. So the effect is that after submit field is marked as correct and after next submit when all fields are correct it is marked as incorrect as validation in bean occrured. How can I make all validations while pressing submit button? Is three any other way?