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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 15632
    
  15

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?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to dynamically change color in row?
 
Similar Threads
Changing Color of a selectedtext in TextArea
Scrollbar thumb color
Changing border color in JOptionPane
Change color of image
how to Change JSpinner&JComboBox Arrows Color?