<s:select name="languageCode"
       list="languageList"
       listKey="iso2Code"
       listValue="%{getText(iso2Code)}"  />

This code will iterate over the languageList and look for a iso2Code
property on each bean within the languageCode.  Based on your description, I
don't think that's the intent.  Try something like this:

<s:select name="languageCode"
       list="languageList"
       listKey="top"
       listValue="%{getText(top)}"  />

'top' should grab the top element of the OGNLValueStack, since what you
really want is the strings that you are interating over.



On 2/6/07, d4kris <[EMAIL PROTECTED]> wrote:


Hi,

Im trying to populate a select list with the select tag and would like the
listValue to lookup a message in a resource bundle. Does anybody know if
this is possible or do I have to populate my list with the proper values
before sending it to my jsp?

Example:
I have a property languageList, which is a list of language codes like
'en',
'fr' etc.
The select list I want to generate should have the iso2Code as key and the
message from a resource bundle with the key iso2Code.

So something along these lines:

<s:select name="languageCode"
        list="languageList"
        listKey="iso2Code"
        listValue="%{getText(iso2Code)}"  />

Any ideas?
Thanks
/K
--
View this message in context:
http://www.nabble.com/s2-Select-listValue-with-message-bundle-key-tf3181085.html#a8827596
Sent from the Struts - User mailing list archive at Nabble.com.


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


  • Re: s2 Select listValue with message bun... Tom Schneider

Reply via email to