wood burning stoves 2.0
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 Make it so: Java DB Connections & Transactions this week in the JDBC 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: 17280

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: http://aspose.com/file-tools
subject: Different styles for stelectItems items
jQuery in Action, 3rd edition