Joern Wallstabe wrote:
The countryselector example shows how to change a selection list inside an event handler.

Indeed, I should've pointed this out in my reply, but I was in a hurry.


Is this the only way e.g is there a <wd:load> to fill the list inside an event handler.
Can it be done without an event handler in flow like:
...
var states = [
    { key: "AL", value: "Alabama" },
    { key: "AK", value: "Alaska" },
    { key: "WY", value: "Wyoming" }
];

mylist=form.getWidget("list");
mylist.setSelectionList(states, "key", "value");

You could do it that way, but there's a better way. See the javadoc for the org.apache.cocoon.woody.datatype.FlowJXPathSelectionListBuilder class.


In short, put this in your form definition:

        <wd:selection-list type="flow-jxpath"
          list-path="states" value-path="key" label-path="value"/>

and show the form using:

form.showForm(uri, { "states" : states });

Hope this helps,

Ugo

--
Ugo Cei - Consorzio di Bioingegneria e Informatica Medica
P.le Volontari del Sangue, 2 - 27100 Pavia - Italy
Phone: +39.0382.525100 - E-mail: [EMAIL PROTECTED]


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to