webtier@glassfish.java.net

Re: [webtier] Redirect on Post with view parameters

From: Ed Burns <Ed.Burns_at_Sun.COM>
Date: Tue, 17 Nov 2009 08:02:38 -0800

>>>>> On Thu, 22 Oct 2009 08:05:49 -0700 (PDT), webtier_at_javadesktop.org said:

SH> Hello,
SH> I try to figure out to implement a dialog using the redirect-on-post pattern.

SH> I want to achieve the following:
SH> 1) Link to /faces/article.xhtml?id=4711
SH> 2) Preload article from database
SH> 3) rendering the form
SH> 4) form submit, action is saving the article and leaves a "Saved message"
SH> 5) redirect to 1) and print the message

SH> Actually only step 4 is the problem. The reason is that the form doesn't offer an attribute include-view-params. How should I solve this?

SH> 1) and 2) can easily solved with a view param and <f:event type="preRenderView"
SH> 3) is no prob
SH> 4) This is step, where I currently loose the view parameter
SH> 5) works with return "article?faces-redirect=true" or a navigation rule. Messages can be preserved using the flash,keepMessage method.

I'm sorry for the big delay. The combination of finishing up
Glassfishv3 and presenting at a week long conference in Brazil has
prevented me from getting to your issue any earlier.

I recommend in your action you programmatically push the message into
the flash. You don't even have to use a FacesMessage to do it, but you
certainly can. You can access the flash from the ExternalContext.

Please followup so we can continue this discussion further.

Sincerely,

Ed

-- 
| ed.burns_at_sun.com  | office: 408 884 9519 OR x31640
| homepage:         | http://ridingthecrest.com/