cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robby Pelssers <Robby.Pelss...@nxp.com>
Subject RE: how to set initial value in MultiValueField widjet
Date Mon, 19 Sep 2011 12:49:50 GMT
Hi Serge,

You can still use the 2.1.10 API for checking how cocoon forms works.

http://cocoon.apache.org/2.1/apidocs/

Check org.apache.cocoon.forms.formmodel.MultiValueField


Normal way is to first get hold of the widget in question using flowscript.  

Then you can invoke either the
-setValue(Object value)
-setValues(Object[] values)


Some sample code for your flowscript:

cocoon.load("servlet:forms:/resource/internal/flow/javascript/Form.js");
var formdefinition = new Form("cocoon://pattern_pointing_to_your_formdefinition");
var formWidget  = formdefinition.form;

//now to lookup a widget you do sth like this
var mymultivaluewidget = formWidget.lookupWidget("replace_this_by_widget_id");

mymultivaluewidget.setValues(somevalues);

Hope this helps,
Robby Pelssers

-----Original Message-----
From: Сергей Алешин [mailto:fktiby@gmail.com] 
Sent: Sunday, September 18, 2011 2:06 PM
To: users@cocoon.apache.org
Subject: how to set initial value in MultiValueField widjet

Hello everyone!
I use Cocoon 2.2.
Please tell me how to set initial value in MultiValueField widjet?
-- 
Serge Aleshin

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

Mime
View raw message