Table and setCellStyleGenerator

Hello All,

Is there any way to change the color of the contents in the table after the table is loaded?

I have a vaadin application containing table. I want to change the color of text in the table after an operation (clicking a button). Can I do that using setCellStyleGenerator? If yes, how?

Many thanks.

Yes, you can. Use the clicklistener to set a class variable and tell the table to update itself, like this: useDarkBackgroundInTable=true; table.refreshRowCache(); And then check that variable in the CellStyleGenerator and return a style name accordingly.