Conditionally setting the font color of an item in a drop down box in JSF
Posted
by Greg
on Stack Overflow
See other posts from Stack Overflow
or by Greg
Published on 2010-05-23T18:13:19Z
Indexed on
2010/05/23
18:21 UTC
Read the original article
Hit count: 189
jsf
I'm a newbie to web programming, so please bear with me. I am using JSF 1.2 and I want to conditionally set the color of the items in my drop down list.
In other words, I have a collection of items that, along with a key and a value, also have a boolean property, warning, that is dynamically set by user action. I want the drop down to show all of the items, but those whose warning property is set to true should be displayed in red.
I assume I have to extend the SelectItem class to add in the boolean property. How do I then conditionally set the color of the font of those items whose warning property is set to true in my JSP pages?
Thanks in advance
© Stack Overflow or respective owner