On Thu, 06 Nov 2003 09:08:43 +0100
Ugo Cei <[EMAIL PROTECTED]> wrote:
> 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
>
Thanks a lot. Works perfectly :-)
joern
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]