问题
Is it possible to refresh a single row of a vaadin table
component?
So far, if table row editing is finished, I'm just refreshing the whole table:
table.refreshRowCache();
But that will probably cause performance issues later for large tables. So, how could a single row be refreshed?
回答1:
I found this on the Vaadin forum which seems useful: https://vaadin.com/forum/#!/thread/408555/408554
I haven't yet given it a go but, Henri Sara (Vaadin developer) suggested this solution:
Property statusProperty = pqTable.getContainerProperty(itemId, "statusString");
if (property instanceof MethodProperty) {
((MethodProperty) statusProperty).fireValueChange();
}
He also notes that this method may change in a future version (and may have done so already :S)
回答2:
1.update your beanItemContainer
2.table.refreshRowCache();
Example:
beanItemContainer.getItem(itemId).getItemProperty("quantity").setValue(productEditor.getProduct().getQuantity());
table.refreshRowCache();
来源:https://stackoverflow.com/questions/19077760/how-to-refresh-a-single-row-in-a-table