Hi Jeromy,

Jeromy Evans wrote:
Ah, I see the problem better now.  In your select:

<s:select multiple="true"
   name="myObjects"
   list="myObjects" listKey="id" listValue="name" />
you're trying to access myObjects as both a list of objects (list=) and as a string (name=). You can't do what you're describing because convertToString needs to provide the currently selected value for the select.

I presume you don't really mean that, but rather want:
<s:select multiple="true"
   name="mySelectedObject"
   list="myObjects" listKey="id" listValue="name" />

where mySelectObject is the same class as the elements in the list, and type conversion ensures that the select contains id:name and sees just the selected object loaded from persistence and provides a list of objects loaded from persistence (no handling of strings what-so-ever).

Sorry, now I see that my example was misleading. Let me try again:

F.e. I would want to display a list of myObjects, and a "multiple" select box where you can modify the list.

List:
<s:iterator value="myObjects" var="o" >${o.name}</s:iterator>

Select:
<s:select multiple="true" name="myObjects" list="availableMyObjects" listKey="id" listValue="name" />

This way, the iterator would need to get a collection from getMyObjects() (without type conversion), but the select would send IDs which needed to be converted.

Now the funny thing is that this seems to work. I got all sorts of exceptions at first, but they don't seem to be related to conversion.

Thanks for all your help, and I'm sorry for wasting your time on this one. I'll get back when I find the real problem, should it be related to struts.

Daniel

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

Reply via email to