sorry i was too fast... 
the solution  

var test;

form = new Form("my-form.xml");
wid = form.lookupWidget("test");
wid.setValue(test);

form.showForm("registration-display-pipeline");
var test = cocoon.request.test;


only works fine with input field widgets but not with booleanfield
widgets. There i get an error: 

java.lang.RuntimeException: Cannot set value of boolean field "test" to a
non-Boolean value.

Same as with the text field i use it to figure out if it has been "changed"
before and redisplay its old value... all to solve my multi page from
problem.... user has enterd a falue in page 2 and submitetd it then goes
back to page 1 and changes something and submits page one. now i want page 2
to be displayed again but with the data entered before!


thanks again!
phil






> thank you Bart it works now! 
> 
> what i like most about Cocoon
> is the community of users and 
> developers! thanks guys!
> 
> regards,
> phil
> 
> 
> 
> 
> > No, the code belongs to your flowscript.
> > 
> > var name = "Cocoon";
> > 
> > form = new Form("my-form.xml");
> > wid = form.lookupWidget("name");
> > wid.setValue(name);
> > 
> > ...
> > 
> > form.showForm("form-pipe");
> > 
> > ...
> > 
> > > 
> > > Thank you Bart, Gunter and Nacho!
> > > 
> > > still i am not shure how to use this:
> > > 
> > > nameWidget = form.lookupWidget("name");
> > > nameWidget.setValue(name);
> > > 
> > > can i put this in my Flowscript? Again i want to pass a variable
> > > from a flowscript and set it as default value for the widget.
> > > I guess the code above belongs in the cfrom template but how do i pass
> > the
> > > variable "name" to it?
> > > 
> > > 
> > > > and with v2 of the javascript API, you could write:
> > > >
> > > > var form = new Form("form1.xml");
> > > > var wid = form.getWidget();
> > > > wid.name.value = name;
> > > >
> > > uhh, how can i use version 2 of the javascript API?
> > > 
> > 
> > cocoon.load("resource://org/apache/cocoon/forms/flow/javascript/v2/Form.
> > js");
> > 
> > (ie load Form.js from the v2/ directory). But the code above should work
> > with the regular (version 1) Form.js
> > 
> > > 
> > > Thanks again,
> > > phil
> > Bart
> > 
> > 
> > ---------------------------------------------------------------------
> > 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]

Reply via email to