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

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


      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?