I'am not sure, but I think you can access the attributes 
of your bean with value.myattribute

<s:select list="mymap" listKey="key" listValue="value.myattribute"/>

Best Regards

Johannes Geppert


Stephen Turner wrote:
> 
> Hello all,
> 
> I'm playing with the Struts 2 <s:select> tag, trying to use a Map as the  
> backing collection for the options list. This is Struts 2.0.11.
> 
>  From the docs: "Iterable source to populate from. If the list is a Map  
> (key, value), the Map key will become the option
>   'value' parameter and the Map value will become the option body."
> 
> So I have a Map, with values of type PayPeriod, which is a simple Java  
> bean. What I get in the rendered values is the String representation of  
> the class ( "yadda.yadda.payper...@dfg65" ). Is it possible to code  
> something in the tag to get a PayPeriod bean attribute showing as the  
> rendered value? I know I can cheat by defining a toString() method in the  
> bean, but I wondered if there's a cleaner way of doing this.
> 
> Thanks,
> Steve
> 
> -- 
> Stephen Turner
> Senior Programmer/Analyst - SAIS
> MIT IS&T
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 
> 
> 


-----
---
web: http://www.jgeppert.com
twitter: http://twitter.com/jogep

-- 
View this message in context: 
http://www.nabble.com/Using-Map-as-option-list-source-with-%3Cs%3Aselect%3E-tag-tp24917991p24918231.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to