Laurie Harper <laurie <at> holoweb.net> writes:
> <s:select name="region" list="regions"
>            listKey="id" listValue="name"
>            headerKey="-1" headerValue=""
>            label="Region:" labelposition="left"/>

Hi Laurie,

I ran into a similar problem a few days ago. I posted my workaround here:

http://article.gmane.org/gmane.comp.jakarta.struts.user/134624

Since then, I've been using FreeMarker for some of the results. That ends up
giving one more workaround:

Using your example (ignoring the Region converter for now), this would work in
FreeMarker:

<@s.select name="regionId" list="regions" listKey="id" listValue="name" 
           headerKey="-1" headerValue=""
           label="Region:" labelposition="left" value="regionId.toString()" />

If you wanted to keep this workaround in the JSP itself, without using the
Integer/String workaround in the model that I mentioned above, you'd have to do
something like this:

<s:select name="regionId" list="regions" listKey="id" listValue="name" 
           headerKey="-1" headerValue=""
           label="Region:" labelposition="left" 
           value="regionId == null ? '-1' : regionId.toString()" />

A bit ugly, but it should do the job until the bugs are fixed.

Cheers,

 - stuart


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

Reply via email to