On Thu, 11 Apr 2002 07:15:10 -0500, "Ivelin Ivanov" <[EMAIL PROTECTED]> wrote:

> > Say the checkbox could be obtained from the request using the "hasCar"
> > name. You can then write something like this:
> >
> > function transaction()
> > {
> >   ...
> >   sendPage("page1");
> >   var hasCar = cocoon.request.getParameter("hasCar");
> >
> >   // do some other stuff to prepare page2, then send it
> >   ...
> >   sendPage("page2");
> >
> >   // now if the user has a car we need to ask information on the car
> >   if (hasCar) {
> >     sendPage("getCarInfo");
> >
> >     var make = cocoon.request.getParameter("make");
> >     var model = cocoon.request.getParameter("model");
> >     var color = cocoon.request.getParameter("color");
> >
> >     // pass the above information to the Java business logic to insert
> >     // it in a database
> >   }
> >
> >   // now ask other questions
> >
> >   sendPage("restOfQuestions");
> >
> >   ...
> > }
> >
> >
> > The idea is that since the flow control is a full programming
> > language, you can do pretty much everything in it.
> >
> > As you notice the flow control is acting the Controller in the
> > Model-View-Controller paradigm (MVC). The Model is the business logic
> > behind, and the View is invoked using sendPage().
> 
> Beautiful.
> 
> I want to understand more of the internals. How do you ensure that
> the "action" attribute on the form in "page1" points to a URL which
> will allow sendPage("page1") to ever return?

Good question!

If you look in the implementation of sendPage, you'll notice that the
WebContinuation object is also passed down to the Cocoon pipeline. In
the jpath.xsl logicsheet there's a <jpath:continuation> element, which
will insert in the output page the continuation identifier.

You can use this in the XSP page to generate the value for the
"action" attribute of the form. Check out the getNumberA.xml and so on
pages in the calculator Schecoon example (in the webapp/examples/calc/
directory).

Greetings,
-- 
Ovidiu Predescu <[EMAIL PROTECTED]>
http://www.geocities.com/SiliconValley/Monitor/7464/ (GNU, Emacs, other stuff)

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to