File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes How to add and update a message during a backing bean listener? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "How to add and update a message during a backing bean listener?" Watch "How to add and update a message during a backing bean listener?" New topic
Author

How to add and update a message during a backing bean listener?

Luciano Assis
Greenhorn

Joined: Apr 30, 2008
Posts: 16
Hello,

I got a Composite Component with a class anotated with @FacesComponent that has a ActionListener, ValueChangeListener and much more.

My Problem is that in some situations I do need to add a FacesMessage and update my p:messages tag with the new message.

I Tried everything to solve this problem... but the p:messages is not rendering my messages.

Maybe because the Faces Messages is rendered only after the complete JSFLife Cycle and as far i know... JSF Listeners do not obey the normal JSF Life Cycle.

How can I add the message?

Thank's for your help.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15961
    
  19

JSF listeners do, in fact participate in the JSF lifecycle. What part of the lifecycle the listener is invoked in depends on what kind of listener it is. However, most listeners post messages by throwing Exceptions, not by attempting to attach them to the FacesContext.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to add and update a message during a backing bean listener?
 
Similar Threads
Threads in JSF?
SelectOneMenu - Validation Error: Value is not valid
synchronization validation and display of dialog in a primeface JSF2.0 form
Validation Messages in different h:Message components inside same form
Issue: commandButton's onsucess attribute not working as expected