Christopher Oliver wrote:
Ovidiu,Interesting!! Could you tell a litle bit more about how this construct works? What corresponds to the try block in ordinary exception handling
I think the below would also work, without changing system.js or any Java code by using Rhino with continuations extended JavaScript syntax:
catch (continue) {
// The continuation I'm part of is about to be restored
// code to handle that goes here.
}
catch (break) {
// I'm about to be captured in a continuation
// code to handle that goes here
}
Regards,
Chris
function multiPageForm()IMHO the above code is complicated to follow and requires good knowledge about how continuations work to be graspable. I prefer the construction Ovidius construction proposed as it abstracts away the use of continuations. Futhermore, in general one need different code for collecting request parameters for different form pages.
{
var a, b, c;
// Reset the local variables with form parameters from
// the request if this call frame is part of a
// continuation being restored.
catch (continue)
{
a = cocoon.request.get("a");
b = cocoon.request.get("b");
c = cocoon.request.get("c");
}
sendPageAndWait("page1.html", {...});'
// at this point 'a' contains the value of the request parameter
....
sendPageAndWait("page2.html", {...});
// at this point 'a' and 'b' contain the values of the request parameters
....
sendPageAndWait("page3.html", {...});
// at this point 'a'. 'b' and 'c' contain the values of the request parameters
....
}
What about implementing Ovidius construction with the concepts you described? Maybe something like the following could work:
// Similar to sendPage() in system.js
function formSendPageAndWait(uri, bizData, collectRequestParametersFun, timeToLive)
{
catch (continue) {
collectRequestParametersFun();
}
return sendPageAndWait(uri, bizData, collectRequestParametersFun, timeToLive);
}
Regards,
Daniel Fagerstrom
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]