Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Outputting a success message  RSS feed

 
Dave Alvarado
Ranch Hand
Posts: 436
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I understand that the <h:messages> tag outputs validation errors and such, but how can I add a "success" message to there? If all goes well, I want to output a message "Saved successfully" and was wondering how to access the h:messages field from my controller.

Thanks, - Dave
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use FacesContext#addMessage(). Read the API docs for details. You can provide a null client ID to get it displayed in a h:messages component.
 
jaini Naveen
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To display the messages, there is a post describes and gives a readymade messages component.
this component will display the messages in the Java script alert

custom component for alert messages
[ September 24, 2008: Message edited by: jaini Naveen ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!