This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes JSF and the fly likes Changing color of a specific row in a datatable using icefaces Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Changing color of a specific row in a datatable using icefaces" Watch "Changing color of a specific row in a datatable using icefaces" New topic
Author

Changing color of a specific row in a datatable using icefaces

Cesar Huasupoma
Greenhorn

Joined: Nov 12, 2012
Posts: 8
Hi, i'm new in icefaces so i have a problem and i hope you can help me.
I have a datatable with data (no problem here) but i need to put a red background colo to an specific row from java because it is suppose to be a restriction from a condition is there a way i can do that?

Example:

i got a table with 5 products and all of them have an expiration date so... 4 products are ok but one has expired 5 days ago so i need to color that row with red
Vladimir Mokrozub
Greenhorn

Joined: Aug 31, 2012
Posts: 12

Here, rowIndexVar is an index and rowStyleClass is a style class of current row. In your backing bean set expiredProductIndex to the index (zero-based) of row you want to color with red.
Cesar Huasupoma
Greenhorn

Joined: Nov 12, 2012
Posts: 8
I was thinking something like that but doing something like this:

I get some data from a query from database so I'm getting this: 1 (true) or 0 (false)
In the bean class i will have a variable called expiredProduct and the get method is called isExpiredProduct
so the code could be:

you think this is ok?
Vladimir Mokrozub
Greenhorn

Joined: Aug 31, 2012
Posts: 12
If your row objects contain expiredProduct property, this seems ok.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Changing color of a specific row in a datatable using icefaces