Mark,
I am actually using an application exception send the message(String
key, Object[]) to the client and then a utility within the flow to
retrieve an i18n message from a resource bundle using the user's locale.
The message is then bound to an output widget and then I want to
redisplay the same form with the messages and original form content.
I have a "close" submit button which the user can use to end the loop
I there a way that I can update the form model with the message and then
redirect the user to the previous continuation id just like how
<actions> behave?
Thanks.
Below is a snapshot of the flow
form.showForm("material-type-display-pipeline", data); //show form
//if submit is a close exit the loop
if (form.submitId == "close") {
dispatch = null;
cocoon.sendPage("");
}else {
var msg = form.getWidget("message");
form.save(bean);
try {
//Perform backend processing
}catch(ex) {
var msg = form.getWidget("message");
if(ex instanceof Packages.BaseAppException) {
var i18nVal = Packages.ExceptionHandler.
getWebExceptionMessage("bundleName","users locale",ex);
msg.value = i18nVal;
} else {
throw ex;
}
}
form.showForm("material-type-display-pipeline", data); //redisplay form
-----Original Message-----
From: Mark Lundquist [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 06, 2004 10:25 AM
To: [EMAIL PROTECTED]
Subject: Re: Cform - Help with redisplaying form after submission
On Apr 6, 2004, at 9:52 AM, Uchenna Igwebuike wrote:
> Thanks mark
>
> When I redisplay form using
>
> form.showForm("material-type-display-pipeline", data);
>
> it will redisplay the form but the continuation id changes and If I
> post
> the form this point it doesn't execute the correct flow and comes back
> with a blank page.
Well, sure :-)... it does what you expect resuming a continuation to
do, right? It sounds to me like you just want to wrap a big loop
around the showForm() and all the rest. There's nothing wrong with
that! Nothing says a flowscript ever has to return (although if you
want to get fancy and implement a server-side 'dismiss' you can do
that, too).
>
> I am trying to have all the messages displayed with an <output> widget
> in the form and not have to create a new JXTemplate pipeline as the
> user
> could continue to edit the form even after saving the changes.
Not sure exactly what you mean by "create a new JXTemplate pipeline"...
if you mean a new invocation of the pipeline, that of course is
happening anyway no matter what. If you mean "a separate pipeline in
the sitemap", there's no need for that... just have one pipeline that
starts w/ the JXTG, and use the jx:template anyway even when you don't
have an extra message to display.
It looks like 'bean' is your "DTO" (and 'sproxy' the interface to the
'real' model)? In which case you would be shoving the failure message
into 'bean' so it can get bound to your output widget? Nothing wrong
w/ that... I probably would have used JXTG, but it's all a matter of
taste I guess...
~ mark
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]