This status image is changed in real time on some event which occurs every 1-2 seconds. So every 1-2 seconds I see how table is blinking, because it renders generated column.
How to avoid it? Can we change only one row for which status is changed, not all generated column?
Unfortunately, not. This is Vaadin table behavior. In your case, Iād recommend get rid of images and generated columns at all. Instead, use styles to display different status. The idea is that you hide text representation of status and generate an icon using CSS, e.g. FontAwesome circle icon:
@Install(to = "customerTable", subject = "styleProvider")
protected String customerTableStyleProvider(Customer customer, String property) {
if (property.equals("grade")) {
switch (customer.getGrade()) {
case PREMIUM:
return "premium-grade";
case HIGH:
return "high-grade";
case STANDARD:
return "standard-grade";
}
}
return null;
}
.premium-grade,
.high-grade,
.standard-grade {
.v-table-cell-wrapper {
color: transparent; // hide text
// generate an icon
&:before {
font-size: $v-font-size;
font-family: FontAwesome;
content: "\f111";
}
}
}
// Set different color depending on grade
.premium-grade .v-table-cell-wrapper:before {
color: red;
}
.high-grade .v-table-cell-wrapper:before {
color: blue;
}
.standard-grade .v-table-cell-wrapper:before {
color: green;
}
This approach is much more lightweight than using images.