cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Lundquist>
Subject Bookmark continuations (was Re: Aack!)
Date Wed, 10 Mar 2004 17:58:31 GMT
(I changed the subject line now that I have a clue what this is 
about... "Aack!" is not very helpful to the community, me thinks :-)

On Mar 10, 2004, at 7:25 AM, Christopher Oliver wrote:

> See the use of form.setBookmark() in the v2 API. It allows you to 
> reacquire your bizData each time the form is redisplayed.
> Chris

Thanks Chris... sounds like this will help.

I checked the samples... the only example of bookmarking continuations 
is the "back" button in a multipage ('wizard') form sequence.  No 
example of setBookmark().  I tried searching the v2 API itself, the FOM 
source code, and finally Google, and came up bone-dry.

Then I ran across this, right there in the "Advanced Flow Control" page 
of the Cocoon docs:


Function [WebContinuation] createWebContinuation()

Creates a new "bookmark" WebContinuation object. When invoked it will 
cause the script to resume right after the call. By calling this 
function prior to sendPageAndWait() you can be create a "bookmark" 
which will cause the page to be redisplayed in the browser. Note: the 
WebContinuation associated with sendPageAndWait() doesn't do this. 
Rather it resumes execution after the the page is submitted.

  For example:

function processPage() {

   var bkm = cocoon.createWebContinuation();
   var biz = getBizData();
                          {bookmark: bkm, biz: biz},
                          function() { releaseData(biz); });

This looks like it might be on the right track... is it?  If so, I have 
some more questions...  I don't understand at all what is going on in 
the call to sendPageAndWait in this example.  So there's this 
javascript object literal:

	{bookmark: bkm, biz: biz}

and it would seem that this object is the bizdata as far as 
sendPageAndWait is concerned...?  So I'm confused about where/how the 
'bookmark' property of that object achieves it effect. The doc says 
what the bookmark will do "when invoked"... but how/where is it 
invoked?  Looking at the implementation of sendPageAndWait, it always 
creates a new WebContinuation to pass to sendPage... Do I still specify 
the <form action="..."> in the same way, or am I supposed to reference 
previousContinuation or something, or what?

And all this begs the question of how to use this bookmark approach 
with the Woody/Flow integration, where you want to be calling 
showForm() instead of sendPageAndWait() directly... and in particular, 
with the v2 API, where apparently the widget tree is the (implicit) 
bizdata (?)

So many questions... so little time to get all this working... :-/

Thanks a lot for all the help so far!

View raw message