struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Newton <davelnew...@gmail.com>
Subject Re: How to string concatenate listValue in struts (radio) tag?
Date Wed, 27 Jun 2012 11:14:52 GMT
My idea would be to create presentation layer data outside of the JSP.

Dave

On Wed, Jun 27, 2012 at 6:38 AM, Mounir Benzid <mb@meetingmasters.de> wrote:

> Hi
>
>
> here's the deal.
>
> Suppose I want to display a <s:radio> tag showing a list of
> TicketDescriptions where each has the property ticketName, i.e. a method
> getTicketName()).
> getTicketName itself returns an instance of type LocalizedString for which
> I wrote a custom struts conversion.
> LocalizedString  is basically an enhanced java.util.String object which
> contains the TicketDescription's name.
> After the conversion ticketName will be of type java.lang.String.
>
> So this is what I use so far:
>
>                        <s:radio name="ticket"
>                                 list="ticketDescriptions"
>                                 listKey="id"
>                                 listValue="ticketName"
>                                 />
>
>
> and as an example results in
> [ ] student ticket
> [ ] VIP ticket
> [ ]...
>
>
>
> BUT what I really would like to see is
>
> [ ] student ticket (10 Euro)
> [ ] VIP ticket (100 Euro)
> [ ]...
>
>
>
> This is what I tried so far but with no avail
>
>
>                        <s:radio name="ticket"
>                                 list="ticketDescriptions"
>                                 listKey="id"
>                                 listValue="%{ticketName +  ' (100 Euro)' }"
>                                 />
>
>
> The output is
>
> [ ] xx.xx.LocalizedString@1bb8d3e[**ID=373,Locale=en,Title="**student
> ticket"] (100 Euro)
> [ ] xx.xx.LocalizedString@1bb8d3e[**ID=374,Locale=en,Title="VIP ticket"]
> (100 Euro)
>
> Any ideas? thanks!
>
>
>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: user-unsubscribe@struts.**apache.org<user-unsubscribe@struts.apache.org>
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message