struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laurie Harper <>
Subject Re: displaying items in different colors in a <s:select> tag
Date Tue, 14 Aug 2007 16:08:31 GMT
Session A Mwamufiya wrote:
> Hi,
> Is there a way, with the current version of struts 2, to use a conditional statement
to color code elements that are displayed in a <s:select> tag.  By this, I mean that
if I have items in my list that are >4, then they're red, and if they are <= 4, then
they are blue.  Obviously, this is not the conditional statement that I would want to use,
but it gives an idea of what I'm looking for.  So for the super creative minds out there,
here's a small nutcracker ;).

A quick look at the documentation for the tag [1] suggests that the 
short answer is 'not out of the box'. There are attributes for 
controlling the CSS class/styles for the containing SELECT element but 
not, as far as I can see, for the individual OPTIONs.

If nothing else, though, you could write a custom template for this 
'special use' and reference it through the template/templateDir attributes.



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message