adding more columns to a table with a beanitemcontainer as data source

Hello All,

I have a BeanItemContainer object which acts a data source to a vaadin table. How do I achieve the below tasks -

  1. I need to add two more columns to the table which will display an icon based on the value of a column. For example if the table has a column called “notes”, then an icon has to be displayed if notes has a value in it.

  2. I need to change the background of the row if a column (date) has a particular value.

Any pointers to the achive the above would be very helpful.

Regards,

The icon you can display with a Table.ColumnGenerator retuning a com.vaadin.ui.Image component.
The background colour you can change with a Table.CellStyleGenerator and styles in your css that match what you returned from the getStyle() method.

.v-table-cell-content-<style-you-returned> {
        color:#0000EE;
        font-weight: bold;
}