File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes dynamic rowclasses Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "dynamic rowclasses" Watch "dynamic rowclasses" New topic

dynamic rowclasses

Denise Smith
Ranch Hand

Joined: Jul 26, 2005
Posts: 36

I have a datatable that I want to set the rowclasses based on data that is in the rows
for example: if a hava a column named number and the first one is 5 I want that row to be style class1. If the next row matches that number I want it to have the same rowclass(class1) if the number is different say 8 I want it to have a different rowclass (class2) so that all consequtive numbers have the same rowclass. My problem is not with the logic but rather with setting the rowclass.

The following method is in a column in my datatable

* @return Returns the rowClass.
public String getRowClass() {

String s = String.valueOf(getValue("#{varPerson['NUM']}"));

if (s != null && (s.compareTo(getNewCcn())==0)) {

} else {

}else if(rowClass.compareTo("rowClass2")==0){


return rowClass;

Surround yourself with learners...They will educate you!
I agree. Here's the link:
subject: dynamic rowclasses
It's not a secret anymore!