I am using Vaadin 8.5.1 Grid to display 1000\'s of rows.
Once a row is updated with change in it property, I use
grid.getDataProvider().refreshItem(selectedRow)
For a item to be seen as the same item, (and the refresh working) you need a corretly implemented equals()
and hashCode()
methods on the object.
From the documentation
public void refreshItem(T item)
Description copied from interface: DataProvider
Refreshes the given item. This method should be used to inform all DataProviderListeners that an item has been updated or replaced with a new instance.
For this to work properly, the item must either implement
equals(Object) and #hashCode() to consider both the old and the new item instances to be equal, or alternatively
DataProvider.getId(Object) should be implemented to return an appropriate identifier.
In addition to this, it's you should create a ListDataProvider
, assign it to the grid and then do the updated via the same instance of the previously assigned ListDataProvider