1 Reply Latest reply on Mar 31, 2010 8:05 AM by ilya_shaikovsky

    How to create FacesMessaage for the passedMarker facet of rich:messages

    deadlock_gr
                   <rich:messages globalOnly="true">
                      <f:facet name="passedMarker">
                          <h:graphicImage url="/images/icons/validation/passed.gif" />
                      </f:facet>
                      <f:facet name="errorMarker">
                          <h:graphicImage url="/images/icons/validation/error.gif" />
                      </f:facet>
                  </rich:messages>
      

       

      this is my rich:messages page:

       

      I want to print a message with the passedMarker facet. I don't know how. I create two FacesMessages, one with SEVERITY_ERROR and one without SEVERITY, but only the first appears correctly, with its icon. The message that should appear with the passedMarker facet shows only its text, without the check icon.

       

      Note that the paths for the icons are correct, and they appear if they are requested directly in the browser.

       

              // display a success message
              String msg = "Applicant " + applicant.getName()
                      + " was created successfully!";
              
              FacesMessage facesMsg = new FacesMessage(msg, msg);
              FacesContext.getCurrentInstance().addMessage(null, facesMsg);
              
              FacesMessage errorFacesMsg = new FacesMessage(
                      FacesMessage.SEVERITY_ERROR, msg, msg);        
              FacesContext.getCurrentInstance().addMessage(null, errorFacesMsg);
      

       

      How can I programmatically create FacesMessages for the passedMarker facet?

        • 1. Re: How to create FacesMessaage for the passedMarker facet of rich:messages
          ilya_shaikovsky

          passed state is not supported at 3.3.x. It was not implemented because of some lack of api for messages storing between requests in JSF and unfortunatelly some artifacts was not removed from docs and maybe from component attributes and leads to such confuses :/. We plan to complete this support in 4.x

           

          Currently simplier way I think is to create just Bean property with successfull message and show it if there are no validation errors after postback.