On Thursday 09 September 2004 12:37, Ulf Sahlin wrote:
> > What you need is a 'redirectAndWait'.
>
> Looking at fom_system.js, the sendPageAndWait method is really a sendPage
> call with some extra stuff, just like you said:
>
> FOM_Cocoon.suicide = new Continuation();
>
> FOM_Cocoon.prototype.sendPageAndWait = function(uri, bizData, fun, ttl) {
> this.sendPage(uri, bizData,
> new FOM_WebContinuation(new Continuation(),
> this.continuation, ttl));
<cut fun stuff>
> FOM_Cocoon.suicide();
> }
>
> It seems it's FOM_Cocoon.suicide(); that halts execution (duh). I tried
> using this:
>
> function testingSome() {
>
> var c = cocoon.createWebContinuation();
> print("Continuation = " + c.id);
> FOM_Cocoon.suicide();
> print("Continued executing.");
> }
This will not work indeed. cocoon.createWebContinuation() will create a new
continuation that will resume directly after the point of creation. You could
try something like this:
function redirectAndWait(uri, ttl) {
var cont = new FOM_WebContinuation(new Continuation(),
cocoon.continuation, ttl));
cocoon.redirectTo(formatUri(uri, cont));
FOM_Cocoon.suicide();
}
But I don't know where the 'Continuation()' comes from. Before I switched to
my new flow engine I used to create a WebContinuation with
'cocoon.createWebContinuation()' and check the request parameters to see if
it's before or after the redirect:
function testingSome(uri) {
var c = cocoon.createWebContinuation();
print("Continuation = " + c.id);
if (cocoon.request.get("afterRedirect") == null) {
cocoon.redirectTo(uri);
} else {
print("Continued executing.");
}
}
This way you have to make sure the user is redirected to the page with
'afterRedirect' set (to 'true' for example). I think this way is less
elegant, because the excution of the flow continuous after the redirect.
Emond
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]