Bug: Grid refresh Items

Description: We encountered an issue when updating a Grid using the following code:

dataProvider.getItems().clear();
dataProvider.getItems().addAll(newItems);
dataProvider.refreshAll();

Scenario:
We have a list of 4 entries displayed in a Grid.
We edit the top entry by updating a field that is also displayed as a column.
After saving, the list is updated using the above code.

Observed Behavior:
The list flickers briefly, and it appears that the updated entry is displayed.
However, the updated entry is immediately replaced by the old entry.
When selecting and editing the entry again, the new value is used, but only the old value is visible.

Environment:
This issue occurred in our software when upgrading from Vaadin 24.4.13 to 24.5.0.
The issue persists in Vaadin 24.5.7.

Please let me know if you need any further information.

Why don’t you just use grid.setItems()?

1 Like