3 Replies Latest reply on Dec 20, 2011 3:51 AM by Christian Peter

    rich:message cannot work in richfaces4.1Final

    Lu Han Newbie

      Hi,

      In our project, we encountered an issue about rich:message component, it's very urgent for us, please help to solve.

       

      The code:

      <ui:composition xmlns:h="http://java.sun.com/jsf/html"

                xmlns:f="http://java.sun.com/jsf/core"

                xmlns:ui="http://java.sun.com/jsf/facelets"

                xmlns:a4j="http://richfaces.org/a4j"

                xmlns:rich="http://richfaces.org/rich">

      <h:inputText id="managementIP" class="normal_width required ipaddress" maxlength="16" value="#{gatekeeperBean.ip}"/>

      <rich:message id="managementIPMsg" for="managementIP" styleClass="error_message"/>

      </ui:composition>

       

      The issue:

      error-message.PNG

      If we use h:message to replace the rich:message, this issue is solved, but the style is not right.

      Since, there are many rich:message in ou project, we need to know the primary cause.

       

      Thanks in advance!

       

      Eric Han

        • 1. Re: rich:message cannot work in richfaces4.1Final
          Brendan Healey Master

          Eric, to trigger validation (and potentially a message) you need to use ajax or have a full form submit

          take place, but neither are shown. It's also not obvious that there are any validation rules to be enforced,

          unless you're using bean validation. Could you clarify these points please?

           

          The rich:messages component seems to work ok for me in .Final, try this simple ajax example by clicking

          into the input and then click somewhere else:

           

          <h:inputText required="true" requiredMessage="required...">

             <a4j:ajax event="blur" render="msg1"/>

          </h:inputText>

          <rich:messages id="msg1"/>

           

          Regards,

          Brendan.

          • 2. Re: rich:message cannot work in richfaces4.1Final
            Lu Han Newbie

            Thanks Brendan,

            You are right and the richfaces-showcase is good for me, but it's not talking my puzzle.

             

            I must to clear the title, it's not the message doesn't return the right value. Instead, it does (when I add a button and did submt the full form). The issue is when the page loads, I got the error in the explorer's console.

            • 3. Re: rich:message cannot work in richfaces4.1Final
              Christian Peter Expert

              Hmmm, are you using any javascript frameworks, custom code or thirdparty clientsite libraries that we should know of? From the screenshot, I assume you are using chrome. Do you get similar results with firefox?

               

              Please open the chrome develtools (or firebug in firefox), go to the console and enter some javascript and jquery code. Try something like this:

              $('body')

               

              and the this:

              jQuery('body')

               

              Do you get any error messages or just the body object printed out?