5 Replies Latest reply on May 1, 2007 9:09 AM by pmuir

    Problem with FacesMessages

    nstoddar

      I'm having a problem with FacesMessages. I have a pageflow where on a transition I execute a validation method that adds a message to the FacesMessages object. The "to" for the transition is a decision node that calls a method that is trying to determine if there are FacesMessages present and transition based on that logic ... (sorry -- wordy explanation).

      My problem is that the FacesMessage object is returning an empty list for getCurrentMessages() and getCurrentGlobalMessages() -- I can set a breadpoint and see my message sitting there in its member variable list, but I always get an empty list from FacesMessages when I invoke either of those two methods.

      When I add the message directly to the FacesContext, FacesMessages correctly returns me a non-empty list, but the messages aren't visible after the redirect to the next page in my pageflow.

      Am I doing something incorrect here? I was expecting FacesMessages to show me the message I just added to it....

        • 1. Re: Problem with FacesMessages
          saeediqbal1

          what is the scope? what are you using? the rendered tag?

          • 2. Re: Problem with FacesMessages
            nstoddar

             

            "saeediqbal1" wrote:
            what is the scope? what are you using? the rendered tag?


            I'm just doing this in some plain Java code -- all within the same request cycle.

            • 3. Re: Problem with FacesMessages
              pmuir

              Seam does some magic to propagate your FacesMessage across redirects - the messages aren't actually added to the FacesContext until just before they are rendered. The getCurrentXXX() methods are just convenience methods to get the current messages from the FacesContext and don't get the messages enqueued by FacesMessages.

              • 4. Re: Problem with FacesMessages
                nstoddar

                 

                "petemuir" wrote:
                Seam does some magic to propagate your FacesMessage across redirects - the messages aren't actually added to the FacesContext until just before they are rendered. The getCurrentXXX() methods are just convenience methods to get the current messages from the FacesContext and don't get the messages enqueued by FacesMessages.


                Is there a way to determine if there are messages in FacesMessages (before they are propagated across the redirect)?

                • 5. Re: Problem with FacesMessages
                  pmuir

                  Can you file a feature request in JIRA and I'll look at options (it's certainly possible, it's just which way is neatest)