You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by SO...@austin.rr.com on 2007/03/17 05:12:48 UTC

Can you addMessage() from an Action method?

>From all examples, it appears that you should be able to call
addMessage() from within an action method, but when I try this, the
message is not displayed.  Contrarily, I found this discussion where it
says that it isn't possible:

http://jsf-faq.com/faqs/messages.html

and that you have to use a validator.  I tried using a validator and it
did work (the message gets displayed); however, I think that this
approach is rather limiting.  There are errors that are dependent on
more than one input.

I am out of ideas.  Can you call addMessage() from within an action
method and have the error messages (via <h:message for="" />) show up?

Thanks.

Re: Can you addMessage() from an Action method?

Posted by Adrian Mitev <ad...@googlemail.com>.
You can do this with success. This web site is pretty old.

2007/3/17, SOSELLA@austin.rr.com <SO...@austin.rr.com>:
>
> From all examples, it appears that you should be able to call
> addMessage() from within an action method, but when I try this, the
> message is not displayed.  Contrarily, I found this discussion where it
> says that it isn't possible:
>
> http://jsf-faq.com/faqs/messages.html
>
> and that you have to use a validator.  I tried using a validator and it
> did work (the message gets displayed); however, I think that this
> approach is rather limiting.  There are errors that are dependent on
> more than one input.
>
> I am out of ideas.  Can you call addMessage() from within an action
> method and have the error messages (via <h:message for="" />) show up?
>
> Thanks.
>