2 Replies Latest reply on Mar 19, 2010 9:32 PM by Rodrigo Bento

    facesMessages addToControl - message lost

    dragos cernahoschi Newbie

      On form submit some validation is performed and a validation message is enqued:


      facesMessages.addToControlFromResourceBundle("username", Severity.ERROR, "user.uniqueUsername");



      The view is redisplayed but no message is rendered next to the control. A warning messages is displayed instead on the console:


      sourceId=null[severity=(ERROR 2), summary=(Existing username), detail=(Existing username!)]
      



      The responsible view part is bellow:


      <h:form>
      ...                    
         <s:decorate id="usernameDecoration" template="layout/edit.xhtml">
             <ui:define name="label"><h:outputText value="#{messages['account.username']}"/>:</ui:define>
             <h:inputText id="username" value="#{register.username}" required="true"/>
             <ui:define name="errMessage">
                  <rich:message for="username" styleClass="error">
                       <ui:include src="layout/valid-err.xhtml"/>
                  </rich:message>
             </ui:define>                                   
         </s:decorate>
      ...
      </h:form>
      
      



      A rich:messages or h:messages tag displays the message. It seems that the control with the specified id is not found and the message is treated as global one. What happens?