3 Replies Latest reply on Feb 15, 2012 4:04 PM by v2adam

    Add Global Message to rich:notifyMessages

    dadidom

      Hi There,

       

      i have a problem adding an global Message to notify stack. I expected to add a message to jsf messages with null-ClientID will cause to appear that message, but the message will not show (just a general info about missing form-elements)

       

      Page:

      <rich:notifyStack id="globalStack" position="bottomRight" direction="vertical" >
        <rich:notifyMessages ajaxRendered="true" globalOnly="true" stayTime="5000" stack="globalStack"/>
      </rich:notifyStack>
      

      Add Message:

      ctx.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "Summary", "Detail"));
      

       

      Thanks for help.

      Dom

        • 1. Re: Add Global Message to rich:notifyMessages
          v2adam

          Try this, without stack:

           

          <rich:notifyStack id="firstStack" position="topLeft" direction="vertical" method="first" />
          <rich:notifyMessages id="notifyMessagesGlobal" sticky="true" globalOnly="true"  stack="firstStack"/>
          

           

          and in class just add message to context in action method:

           

          FacesMessage facesMessage = new FacesMessage("summary");
          facesMessage.setSeverity(FacesMessage.SEVERITY_ERROR or FacesMessage.SEVERITY_INFO);
          FacesContext.getCurrentInstance().addMessage(null, facesMessage);
          

           

          must work fine!

          • 2. Re: Add Global Message to rich:notifyMessages
            healeyb

            I just use <rich:notifyMessages stayTime="3500"/> and this displays messages submitted without

            a client id.

            • 3. Re: Add Global Message to rich:notifyMessages
              v2adam

              yes, can used without stack and globalOnly, if you want see message in notify, you must set null clientId.