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
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: 17417

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.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: Different styles for stelectItems items
jQuery in Action, 3rd edition