Hi Johannes!

On Aug 10, 2005, at 9:29 AM, Johannes Schaefer wrote:

Hi!

I need a means to pass some parameters between various screens
(flows) but was not successful yet. Below is what I did so far
(but there  may be a better solution).
Now I'm rather lost. :-(

Any help appreciated! Hope we don't have to resort to use
a database to save the values ;-)

uh... no. :-) :-)

Bear in mind that a flowscript function (including one that calls sendPage() or sendPageAndWait()) can be called by another flowscript function; it doesn't have to only be called from the sitemap. And since flow execution context _is_ state, you may not need any "state variable" of the kind shown in your example. So, invoke your subsequent page controller functions _directly_ from within flowscript, instead of dispatching back to a Cocoon pipeline. If you have information to pass between pages in a flow, just pass it in flowscript function parameters.

Of course it is possible to go "continuation crazy", and I think that Cocoon applications should generally follow the spirit of REST principles. However for "wizards" and the like, this sort of approach is entirely appropriate.

Does the above make sense?  If not, please let me know... :-)


I defined a global variable 'state' in our flow.js:
  function State( value )
  {
     this.value = value;
  }
  var state = new State( "Hello World" );

What if you replace that last line with this:

var state;
if (state == null) state = new State ("Hello World");

HTH,
—ml—


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

Reply via email to