cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <>
Subject Re: Thoughts on Woody ...
Date Wed, 22 Oct 2003 15:39:58 GMT
Torsten Curdt wrote:

>> No problem with the wizard approach I suggested: the form contains a 
>> link only to *one* continuation (the one that displayed the current 
>> page), and upon post, the wizard ressurects the previous continuation.
>> This means that the current form can be populated and then the 
>> previous one displayed.
> ok, so let's the say the back button is linked (via POST) to the
> exact same continuation that got us to that particular view - how
> should we actually control to go back to the previous one? we are
> asking for the same one!
> sorry, don't get that...

Let's look again at the (still hypothetical) wizard library:

function myWizard() {
 var wizard = new Wizard();
 // register the current execution location as a backtrack point
 var value = cocoon.request.getParameter("value");
 if (value == "foo") {
 } else {

The wizard object contains a stack of continuations. When 
wizard.markStep() is called, a continuation corresponding to the current 
location is added on the top of the stack. Notice how wizard.markStep() 
is called before every page is displayed: this will allow us to go back 
just before that display.

In wizard.handleBack(), we examine the request for a particular request 
parameter that indicates that the "previous" button was clicked. If we 
find this, we pop _two_ continuations from the stack (the first one 
would just redisplay the same page) and restore that continuation.

When that popped continuation is restored, flowscript execution goes 
back to the wizard.markStep() statement where this continuation was 
pushed on the stack. We then redisplay the previous page.

Is it clearer?

Note: (argh, I will obscure things again) implementation-wise, we can't 
just have a stack in the wizard object, as it would have the same value 
for all continuations (remember, once an object is declared, its is 
shared by all descendant continuations). We need a "ContinuationLocal" 
variable, analogous to "InheritableThreadLocal" but for continuations, 
i.e. the value will be different for every continuation. This is not 
available today, even if I have some ideas on how to do it.


Sylvain Wallez                                  Anyware Technologies 
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
Orixo, the opensource XML business alliance  -

View raw message