10 Replies Latest reply on Sep 27, 2007 4:55 PM by momochone11

    Validation facesmessages not showing up.

    momochone11

      Hi all,

      I tried to switch from Seam 1.2 to Seam 2.0 beta, I am using JBoss AS 4.2.0GA and ran into some problems regarding displaying validation messages. My validation messages keeps on getting enqueued and not displayed after I left required fields empty and submit.

      My JSF form

      <h:form>
       <fieldset class="organization">
       <s:validateAll>
       <f:facet name="afterInvalidField">
       <s:div styleClass="errors">
       <s:message/>
       </s:div>
       </f:facet>
       <p>
       <h:outputLabel for="organizationName"
       value="#{messages['organization.organizationName']}"/>
       <h:inputText id="organizationName"
       value="#{organizationAction.chosenOrganizationName}"
       required="true"
       size="40" styleClass="text"/>
       <s:decorate for="organizationName"/>
       </p>
      
       <p>
       <h:outputLabel for="website"
       value="#{messages['organization.website']}"/>
       <h:inputText id="website"
       value="#{organization.website}"
       required="true"
       size="40" styleClass="text"/>
       <s:decorate for="website"/>
       </p>
       </s:validateAll>
       </fieldset>
      
       <h:commandButton value="#{messages['wizard.next']}" action="#{organizationAction.validate}" styleClass="submit"/>
       <s:button view="/p/organizationList.xhtml" propagation="end"
       value="#{messages['button.cancel']}" styleClass="submit"/>
      
       </h:form>


      After I submit the form with all fields blank, I keep getting this error message in the console...

      2007-08-14 09:53:45,453 INFO [javax.enterprise.resource.webcontainer.jsf.lifecycle] WARNING: FacesMessage(s) have been enqueued, but may not have been displayed.
      sourceId=j_id44:website[severity=(ERROR 2), summary=(valeur requise), detail=(valeur requise)]
      sourceId=j_id44:organizationName[severity=(ERROR 2), summary=(valeur requise), detail=(valeur requise)]


      I tried using <h:messages/> instead, and it worked but messages are displayed on top instead... I tried running seam-booking example it works but I don't see anything different that I am doing... I didn't have this problem when I was using Seam 1.2..

      Any help will be appreciated... thanks!