wood burning stoves 2.0*
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
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: 15957
    
  19

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?
 
jQuery in Action, 2nd edition
 
subject: How to dynamically change color in row?
 
Similar Threads
Scrollbar thumb color
Change color of image
Changing Color of a selectedtext in TextArea
Changing border color in JOptionPane
how to Change JSpinner&JComboBox Arrows Color?