1 Reply Latest reply on Nov 15, 2012 2:32 AM by jmsjr

    Added FacesMessage displayed with rich:messages but not with rich:notifyMessages when message via from an ajax call ??

    jmsjr Newbie

      JBoss 7.1.1 (Brontes)

      RichFaces 4.2.3


      I have a method in the backing bean that is adding a FacesMessage to the FacesContext as follows:




      FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR,

        builder.toString(), null);

      facesContext.addMessage(null, message);



      I am using both rich:messages and rich:notifyMessages as follows:




                                                 <a4j:outputPanel id="outputMessages">


                                                     <rich:notifyMessages stayTime="5000" showCloseButton="true" showShadow="true" nonblocking="true" />





      The code that is adding the FacesMessage into the FacesContext is called via Ajax:




                          <h:commandButton id="search" value="Search" action="#{memberDTO.retrieveMemberDetails()}">

                                 <f:ajax execute="f_planCode f_mbrId"

                                  render="outputMessages" />





      When I click on the button triggering the error condition that I am testing, the output from rich:messages is displayed as expected.

      But I do not get any rich:notifyMessages


      The only way so far I could get rich:notifyMessages working is when:

      Adding an onevent attribute to the f:ajax tag, specifying either a javascript function that does nothing, or even specifying a non-existing javascript function.

      But that seems to force a refresh of the entire page.