On Mon, 2003-11-24 at 06:30, Joe Latty wrote:
> I have searched through the archives and docs to no avail.
>  
> In the scenario where I have a selection list built up in javascript
>  
> var states = [
>      { key: "AL", value: "Alabama" },
>      { key: "AK", value: "Alaska" },
>      { key: "WY", value: "Wyoming" }
>  ];
>  
> I pass it into the form:
> form.showForm(uri, { "states" : states });
>  
> and in the field I have the following element:
> <wd:selection-list type="flow-jxpath" list-path="states"
> value-path="key" label-path="value"/>
> 
> How can I select a value eg "AK":
> form.getWidget("myStateDropDown").setValue("AK"); 

hmmm, strange. Maybe it's a problem that the setted value is a
javascript string, so try this:

form.getWidget("myStateDropDown").setValue(new java.lang.String("AK")); 

or alternatively:

form.getModel().myStateDropDown = "AK";

though normally the setValue() call should raise an exception if the
argument is of the wrong type.

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
[EMAIL PROTECTED]                          [EMAIL PROTECTED]


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

Reply via email to