Dear flow gurus,

suppose I have an application that implements the following workflow:

1. Present the user a form to be filled.

2. When the user submits the form, present him a confirmation page, with two buttons: "Confirm" and "Go back"

3a. If the user presses "Confirm", perform some job (e.g. save form field values to a database) and show a "thank you" page.

3b. If the user presses "Go back", go to step 1.

I've tried to implement this use case in a flowscript like the following:

function foobar() {
// Note the use of the "new style" function names
sendPageAndWait("showform", {});
// Collect request parameters here
sendPageAndWait("askforconfirmation", { /* ... field values ... */ });
sendPage("thankyou", {});
}

In the initial form and the confirmation page, I use forms with an action of "kont(" + <jpath:continuation/> + ")".

In the confirmation page, I implement the "Go back" with a link to the following URI: "kont(" + <jpath:continuation select="2"/> + ")".

The value "2" for the "select" attribute is because it looks like using "1" actually refers to the "current" continuation and not the "previous" one as I thought initially. Am I correct and is this a "feature" or a "bug"?

Anyway, that's not a big issue. The big issue is that it does not seem possible to use a continuation to go back to the first form. My understanding is that the first continuation is created, so to say, *after* the first "sendPageAndWait", so there's no state saved before the first form is shown.

If this is indeed the case, how do you propose to implement this use case with Flow? At the moment, I have resorted to using a link of the kind <a href="#" onClick="window.back();return false;"> but I don't really like this solution. I could also use a loop, test a request parameter from the confirmation form and use it to decide between doing a "break" or a "continue", but I don't like it either.

Any suggestions?

Thanks in Advance,

Ugo

--
Ugo Cei - http://www.beblogging.com/blog/


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to