cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Konstantin Piroumian" <kpiroum...@apache.org>
Subject Re: [Flow] Going back and forth with continuations
Date Fri, 13 Dec 2002 18:53:45 GMT
From: "Ugo Cei" <u.cei@cbim.it>
> 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: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message