This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSF and the fly likes insert text after executing action 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 "insert text after executing action" Watch "insert text after executing action" New topic
Author

insert text after executing action

Jukka Nevalainen
Greenhorn

Joined: Dec 14, 2009
Posts: 9
Hi all

I have a template which looks like that:


The 'msgs' are defined in every page like that:

The error handler should return all errors that have to be displayed. Errors are added to the ErrorHandler while processing the action, which obviously happens after the call to ErrorHandler.errors. So, what happens? First, all errors are displayed (there are none). Secondly, the action is being processed and perhaps some erros added. But they are only displayed in the next request/response. The problem is, that the call to ErrorHandler.errors is made before the action is being processed.

How could we change that order?

I'd appreciate if anybody could give a hint.

Regards,
rethab
Sridhar Santhanakrishnan
Ranch Hand

Joined: Mar 20, 2007
Posts: 317
Are you using some JSF extensions? Like RichFaces?
Jukka Nevalainen
Greenhorn

Joined: Dec 14, 2009
Posts: 9
Sridhar Santhanakrishnan wrote:Are you using some JSF extensions? Like RichFaces?

No, nothing
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15959
    
  19

There is no "ErrorHandler.errors" method here. What you are doing is coding an EL expression that references the "errors" property of a bean named "ErrorHandler". Which is a bad choice for a bean name, because you're using the Classname capitalization convention on an instance of a class.

However, like I said, there's no "errors" method, just calls to getErrors() and setErrors(). Or, since this is an output-only component, just getErrors(). The actual value of the "errors" property has be be set somewhere else, such as in an action processor.

As a side note, you're using the "escape" option which means you're apparently planning to output raw HTML. That's not something I recommend as a general rule. It muddies the Model and View boundaries. In fact, ff you look at the JSF standard "messages" tag, you'll notice there is no "escape" attribute there. They provide basic formatting services (table or list view) and leave the rest up to CSS.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: insert text after executing action
 
Similar Threads
problem when using facelets
facelet: different css style for ui:define
Split Pane effect with JSF 1.2, Facelets, Javascript, RichFaces
having clicking on a treeNode from rich:tree change ui:define content (need help)
Trying to get layout worked out for three content panes (using facelets template)