File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes Different styles for stelectItems items Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Different styles for stelectItems items" Watch "Different styles for stelectItems items" New topic

Different styles for stelectItems items

Arsineh Keshishian

Joined: Apr 21, 2008
Posts: 19
Hi guys,

one question:

My code lookes like this:

The informationItems-List is a dynamic List, depending to the user it can have one or many items.

Every item in this list has an special attribte: one item can have the attribute active or inactive.
Depending to this attribute I would like to display the value in different styles.
If an item is activ I would like to display it in green, and if beeing inactiv in red.

How to give every item in the selectItems list a different style?
Does anyone has an idea?

Thank you!
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15959

People ask this question surprisingly often.

The f:selectItems tag is a data definition tag, not a ui definition tag (which would be in "h:" instead of "f:" namespace). So it doesn't have a style or styleClass attribute.

Customer surveys are for companies who didn't pay proper attention to begin with.
I agree. Here's the link:
subject: Different styles for stelectItems items
Similar Threads
XSL: test for first and last occurence of template match
Interesting tiles/struts making a menu question
Select Item Styles
How to sort Map
Icefaces - PanelGrid align