I'm trying to change the color of a row on a table based on a hex value for the row item. I'm basically trying to generate the css on the fly similar to generating a cssLayout like this
CssLayout content = new CssLayout( ) {
@Override
public String getCss( Component c ) {
return "background: " + colorCode + ";";
}
};
Here's the code I'm using now
table.setCellStyleGenerator(
new Table.CellStyleGenerator( ) {
public String getStyle( Object itemId, Object propertyId ) {
return "green";
}
} );
But it only works for setting the stylename, so I'd have to have millions of style names to accommodate all the possible hex values for the colors the user wants.