I understand this, but doesn't this mean that a woody flow function can display only one form?
The few examples I've seen also seem to imply this. The examples generally show one woody form the proceed to some jxt template to show results. Thats fine, but what if I'd like to build a wizard like GUI which proceeds between several different forms?
If each form needs to be initialized with the woody function, this wouldn't work very well.
I've been running cocoon 2.1.2, and I noticed that some of the woody examples changed in 2.1.3. The "registration" example works the way that seems logical to me, that is, a flow function is called and that function creates the forms without the woody(f,f) function.
I'll try to build my example in 2.1.3 and see if theres a difference.
Regards, /Joakim
Joe Latty wrote:
The form object is passed to your makereport function from the woody2.js this is due to the lines:
<map:call function="woody"> <map:parameter name="function" value="makereport"/> <!--using the following element for its form definition--> <map:parameter name="form-definition" value="forms/form1.xml"/> </map:call>
Therefore your function definition would look like this function makereport(form) { print("before showform"); form.showForm("form1-display-pipeline"); ...
Joe
----- Original Message ----- From: "Joakim Verona" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, November 20, 2003 2:04 AM
Subject: cocoon woody/flow question
Hello list,cocoon.load("resource://org/apache/cocoon/woody/flow/javascript/woody2.js");
I'm trying to build a very simple woody/flow example, and have a question on how the woody/flow interaction works.
1) If I look at the "guess a number game" in the cocoon wiki, it doesn't use woody forms, just flow, and is pretty straightforward.
2) If I look at the woody/flow sample it uses the woody js function to start up the form. That starts up a form, loops it until it validates, and then shows an answer page. Pretty straightforward too.
Now, in my own exampe, I would like to jump between several different forms with the flow function. I cant then initialize the forms with the woody function. Some wiki examples indicate that this isnt necessary either, and I cant find the actual purpose of it either.
So I have tried making a woody form this way, and it behaves oddly:
A) If I use a "<input type=submit>" tag directly in the template, validation works, but it never leaves the validation loop. The same form is just iterated all the time.
B) If I use a wd:submit tag (with validation=true) the validation loop isnt done, but its possible to see the value of the validation parameter:
the little flow function looks like below.form?
function makereport() { var form = new Form("forms/form1.xml"); print("before showform"); form.showForm("form1-display-pipeline"); print("after showform"); //never gets here in case A //gets here immediately regardless of validation in case B var model = form.getModel(); if (form.isValid) { print("d1=" + model.startdate); print("d2=" + model.enddate); } else { print("Form is not valid"); } cocoon.sendPageAndWait("ok.html"); }
How is this supposed to be done? Must each form be initialized with the
woody function?
Doesn't this limit the possibilities of the flowscript to use only one
Have I missed something?
(please reply also to me if possible) Regards, Joakim
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
