struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Baldes>
Subject s:select and pre-selection
Date Fri, 29 Feb 2008 08:34:16 GMT

I have a select box:

<s:select name=""
           list="availableObjects" listKey="id" listValue="name" />

"availableObjects" is a list of objects having an id and a name 
property, where id is of type "long". "" is 'converted' to 
its id (as String)  by a type converter.

Now, setting works well with this, but the current value 
is not pre-selected when I load the form. When I show in a 
textfield, the correct ID is displayed (the id of the option which 
should be pre-selected).

I found a hint in the s:select documentation, which says that for 
OGNL-generated maps, the type of the key-attribute must be the same as 
the type of the listKey property in order to match. So I implemented 
"getIdAsString()" and used listKey="idAsString", but it doesn't work either.

What am I doing wrong here?

(I am using struts 2.0.11)

Any help or hint will be appreciated.

Thanks in advance,


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

View raw message