cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Philipp Rech" <philipp.r...@gmx.de>
Subject RE: pass a variable from flowscript into cfrom text input field
Date Tue, 26 Oct 2004 10:00:37 GMT
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?


Thanks again,
phil 




> I believe that getWidget() is deprecated. You should use lookupWidget()
> instead. E.g.
> 
> nameWidget = form.lookupWidget("name");
> nameWidget.setValue(name);
> 
> and with v2 of the javascript API, you could write:
> 
> var form = new Form("form1.xml");
> var wid = form.getWidget();
> wid.name.value = name;
> 
> HTH,
> Bart.
> 
> -----Original Message-----
> From: Gunter D'Hondt [mailto:gunter.dhondt@sofico.be] 
> Sent: Tuesday, October 26, 2004 11:40 AM
> To: users@cocoon.apache.org
> Subject: Re: pass a variable from flowscript into cfrom text input field
> 
> Widget nameWidget = form.getWidget("name"); 
> nameWidget.setValu(name); 
> Gunter 
> 
> 
> "Philipp Rech" <philipp.rech@gmx.de> 
> 26-10-2004 11:29 
> Please respond to
> users@cocoon.apache.org
> 
> To
> users@cocoon.apache.org 
> cc
> 
> Subject
> pass a variable from flowscript into cfrom text input field
> 
> 
> 
> 
> 
> 
> 
> Hello,
> 
> how can i pass a variable from my flowscript into cfrom text input field
> (as
> a default value)? In the Flow it would be like 
> 
> var name = "stefano";
> 
> and the CForm would be 
> 
> <fd:widgets>
>    <fd:field id="name" required="true">
>      <fd:label>Name:</fd:label>
>      <fd:datatype base="string"/>
>     </fd:field>
> 
> So when the user opens the page, "stefano" is written in the field. The
> value has to come from the Flowscript that call the form and display
> pipeline though! a simple document.form.name.value = name; wont work, eh?
> 
> Thank you very much! Danke!
> phil
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message