cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Johnston" <>
Subject Re: [CForms] building dynamic selection list with javaflow
Date Fri, 16 Sep 2005 20:42:42 GMT
> I've read the doc about how to create dynamic
> selection list data in formscript a la this:
> var data = new Object();
> data.cityList = new Array(2);
> data.cityList[0] = {value:"AL", label:"Alabama"};
> data.cityList[1] = {value:"AK", label:"Alaska"};
> form.showForm("flow/myform.form", data);
> ...and I'm wondering if there's a nice way to do it in
> Javaflow such that I don't have to create an object
> with a bunch of named members (ex. cityList) ie. one
> for each selection list.

If you're using JavaFlow then it might be more appropriate/easy to use a
JavaSelectionList.  The docs on it are pretty light, but take a look at

Basically you create a class that extends AbstractJavaSelectionList and
implement the build() method to build the selection list options using
addItem(value, label).  Then instantiate your class, set it as the field's
selection list, and there you go.

Hope that helps.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message