Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to dynamically change color in row?

 
Higgledy Smith
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this:


The css file looks like this:
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18014
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Higgledy Smith
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you once again, Rorco. Where did you learn so much about JSF?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic