From: "Ugo Cei" <[EMAIL PROTECTED]>
> Christian Haul wrote:
> > Interesting. Why not:
> >
> >  function foobar() {
> >    // Note the use of the "new style" function names
> >    var response = null;
> >    do {
> >        sendPageAndWait("showform", {});
> >        // Collect request parameters here
> >        sendPageAndWait("askforconfirmation", { /* ... field values ...
*/ });
> >        response = input("request-param","confirm"); // or
request.getParameter("confirm");
> >    } while (response == null);
> >    sendPage("thankyou", {});
> >  }
>
> Because I'd find it nicer and more elegant not having to rely on an
> extra variable or parameter and use a loop. Continuations are so nice ;-).

Disclaimer: I'm not a flow-script/continuations guru, so please correct me
if I'm wrong.

It seems to me that Christian's version is more correct conceptually, it
allows to perform additional actions when user clicks "Go back", while in
your version the flow engine will automatically return the flow to the
pervious state.

E.g. in most cases when users click "Go back" button they wish to correct
mistakes in the data they have entered, so you have to display not the empty
form, but the form with the data that the user has entered. Will the "-1"
(or "1") flow step retain the filled data in the form? I suspect that won't.
In the above version of the script it would be easy to implement.

But Ugo's approach has another advantage in case when you don't know where
the user came from and you really move him back to the previous form, just
like you do it using window.back().

If it's possible to perform additional actions when the flow is continued
from a historical point then probably the two approaches could be combined.

Konstantin

>
> Ugo
>
> --
> Ugo Cei - http://www.beblogging.com/blog/
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
>
>


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

Reply via email to