This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes JSF and the fly likes Adding error message to FacesContext from action method Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » JSF
Reply Bookmark "Adding error message to FacesContext from action method" Watch "Adding error message to FacesContext from action method" New topic
Author

Adding error message to FacesContext from action method

Joshua Antony
Ranch Hand

Joined: Jun 05, 2006
Posts: 254
I have a datatable containing values. On row click I display the description of that particular record.

In this page there is an update button, when the user clicks update he is directed to different page having the same fields but with some of them editable and a save and cancel button

If user enters some value and clicks save, and the update is successfull then the previous page needs to be shown with the success message.

For this,I had added error message to FacesContext from update action method, but the message never got displayed. I guess this is due to the fact that different FacesContext instance gets created after action method is returned due to forward or sendRedirect.

What is the workaround for this?

Regards,
Joshua


SCJP,SCWCD, Into ATG now!
Joshua Antony
Ranch Hand

Joined: Jun 05, 2006
Posts: 254
Fixed! removed <redirect /> from navigation rule

Regards,
Joshua
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Adding error message to FacesContext from action method
 
Similar Threads
struts + spring action message issue
Conditional Validation Determined By Which Button Was Clicked
multiple execution in the Action class
pass the data from jsp to model
submit form problem