aspose file tools
The moose likes JSF and the fly likes How to dynamically change color in row? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "How to dynamically change color in row?" Watch "How to dynamically change color in row?" New topic
Author

How to dynamically change color in row?

Higgledy Smith
Ranch Hand

Joined: Mar 07, 2006
Posts: 192
I am learning JSF, using ICEFaces dataTable. Is it possible to change the text color in a cell to red if the value equals "HQ"? If it is possible can you give details on how to accomplish this? Thank you.
Rorco Reggz
Greenhorn

Joined: Jul 21, 2009
Posts: 8
Try this:


The css file looks like this:
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16887
    
  26

You can also return a style classname directly from the EL, putting the logic in the backing bean.

One way requires making the page sensitive to particular data values, the other means making the model sensitive to specific view options. Which way is "better" will depend on your particular needs.


Customer surveys are for companies who didn't pay proper attention to begin with.
Higgledy Smith
Ranch Hand

Joined: Mar 07, 2006
Posts: 192
Thank you once again, Rorco. Where did you learn so much about JSF?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to dynamically change color in row?
 
It's not a secret anymore!