1 Reply Latest reply on Jul 12, 2011 10:43 AM by v.bannur

    Faces message is not displaying

    v.bannur

      Hi,

       

      On click of button I am adding faces message (As given below) and redirecting to other page. And I have written the PhaseListener class to propagate FacesMessage between two jsf pages. I have atached the MultiPageMessagesSupport.java class here.

       

      As I debuged the code and confirmed that facescontext (in restoreMessages(FacesContext facesContext)) in MultiPageMessagesSupport.java is restored the error message what I have added previously in "addErrorMsgToPriceChange()"

       

      But this faces message is not showing on the page. Any solution to show the faces message?

       

      Added both rich and html messages in the xhtml page.

       

      <rich:messages/> Or <h:messages />

       

       

      Adding Faces Message onclick of button:

       

      private void addErrorMsgToPriceChange(BigDecimal totalPriceChange)

          {

              String message = "Price has been changed::" + totalPriceChange;

              FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_ERROR, "", message);

              FacesContext.getCurrentInstance().addMessage(null, msg);

          }