1 Reply Latest reply on Sep 16, 2012 7:29 PM by Brendan Healey

    problem with faces messages

    Kishi kiran Newbie



      I have a problem with faces messages,


      In our application I have a <a4j:commandButton>when i click the that button  <rich:modalPanel> popup, in this model pannel i have save , update buttons, when i click that update button, faces message "Successfully updated" is displaying in the model pannel and the background main page, but i dont want to display that faces message on the background page, i need to display only on the model pannel.

      even i clear the faces messages FacesMessage.clear(); and facesmessage.add("SuccesFully Updated"); even though it is displaying in both model pannel and background page,


      Can anyone please tell me how to get rid of the faces message in the background page


      Thanks in Advance!

        • 1. Re: problem with faces messages
          Brendan Healey Master

          You need to post the code really, but the message in the background page isn't just magically appearing, it will be displayed by

          a h:message(s), rich:message(s) or rich:notify* component. If there is no such component in the background page then there will

          be no message shown. Using the h:message components you would also need to render= the component in order for a message

          to be displayed which provides an additional level of control.


          In my application I have replaced the hundreds of h:message components with a single rich:notifyMessage component which is

          placed in a template page. All errors are displayed this way. This is without doubt the single greatest efficiency I have managed to

          introduce and is somewhat pleasing. As long as you use a4j:command* components then errors are automagically produced, so

          if you have an input component with required="true" and you click a button (as long as the execute= includes the input component

          directly or indirectly with @form) then an error will be produced if no value has been entered.









          Freelance Java Enterprise Developer

          JSF Richfaces Ajax Java 6/7 (scjp) EE 6 HTML CSS JavaScript jQuery MySQL JPA Hibernate Eclipselink

          Spring Oracle SQL JPQL Sybase EJB CDI Glassfish Apache JAX-RS Primefaces UNIX Paypal and more..