cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Oliver <res1c...@verizon.net>
Subject Re: [Flow] Going back and forth with continuations
Date Mon, 16 Dec 2002 16:55:09 GMT
Ovidiu Predescu wrote:

>
> On Sunday, Dec 15, 2002, at 23:59 US/Pacific, Ugo Cei wrote:
>
>> Ovidiu Predescu wrote:
>>
>>> One solution would be to define a pseudo-continuation, just after 
>>> you finish the function initialization code, which could be referred 
>>> from the View page template. Something like:
>>> function myFunc()
>>> {
>>>   var a;
>>>   // Long initialization code here
>>>   startForm(); // Creates a dummy continuation, with no page
>>>                // being sent to the browser
>>
>>
>> Since you didn't provide the code for this startForm() function, I 
>> tried to write it myself, copying the code from _sendPageAndWait() 
>> minus the call to cocoon.forwardTo():
>>
>> function startForm(timeToLive)
>> {
>>   var k = new Continuation();
>>   var kont = new WebContinuation(cocoon, k, lastContinuation, 
>> timeToLive);
>>   suicide();
>> }
>>
>> Do you think this would work?
>
>
> Great Ugo! This should work fine, but please do let me know if you 
> encounter any issues.
>
I may be wrong, but I think this needs to be:

function startForm(timeToLive) {
     var k = new Continuation();
     var wk = new WebContinuation(cocoon, k, lastContinuation, timeToLive);
     lastContinuation = k;
     return k;
}

Calling suicide() would terminate the script and since no page was sent 
there is no client involved to restart it.

Regards,

Chris


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


Mime
View raw message