views:

1540

answers:

1

hi,

my form is passing the String name of the country to the action. how can i pass the id of the object country from the combobox to the action?

this is what i have:

s:combobox label="Country" name="country" headerValue="Select" headerKey="1" list="%{countries}" listValue="name"/>

thanks.

+1  A: 

You have missed the listKey attribute. If you change it as:

<s:combobox label="Country" name="country" headerValue="Select" headerKey="1"
list="%{countries}" listValue="name" listKey="id"/>

It will probably work.

See http://struts.apache.org/2.0.14/docs/combobox.html for all the attributes available.

kazanaki
cheers. it works now.
pigouina