In struts 2 I want to use s:select populated from a Map.
My map has values like
"key1" , "value1"
"key2" , "value2"
Keys are what I want to be posted (which are) but it diplays values. I don't want to show the values but the value returned form a method I use in others (like s:text) getTranslation("value1") and show that value.
If I try
<s:select ... list="myMap" listValue="getTranslation(myMap)">
It doesn't show anything, just empty boxes to select. How do I get the id of the iteration to populate to select so as to use something like:
<s:select ... list="myMap" listValue="getTranslation(myMap.get( how do I get this id? ))">
Or something similar?
Rendering of
<s:select list="myMap" />
is equals to
<s:select list="myMap" listKey="key" listValue="value" />
then try the following
<s:select list="myMap" listValue="getTranslation(value)" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With