-none- 2007-08-14 - By Laurie Harper
Back 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.
L.
[1] http://struts.apache.org/2.x/docs/select.html
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------ To unsubscribe, e-mail: user-unsubscribe@(protected) For additional commands, e-mail: user-help@(protected)
|
|