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]

Reply via email to