diff options
author | Teemu Suo-Anttila <tsuoanttila@users.noreply.github.com> | 2018-01-25 14:36:51 +0200 |
---|---|---|
committer | Ilia Motornyi <elmot@vaadin.com> | 2018-01-25 14:36:51 +0200 |
commit | 2f6f2970bc8ea8bb7d4745b9e87255874ef9fb5e (patch) | |
tree | 67fd727ae9e58932ebc3fec2fa4d46c6b4fac15c /server | |
parent | cf0d3dcc5ad32285b91e7d998cf628ef9c83da55 (diff) | |
download | vaadin-framework-2f6f2970bc8ea8bb7d4745b9e87255874ef9fb5e.tar.gz vaadin-framework-2f6f2970bc8ea8bb7d4745b9e87255874ef9fb5e.zip |
Fix Grid not updating selected item immediately (#10569)
Diffstat (limited to 'server')
-rw-r--r-- | server/src/main/java/com/vaadin/data/provider/DataCommunicator.java | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/server/src/main/java/com/vaadin/data/provider/DataCommunicator.java b/server/src/main/java/com/vaadin/data/provider/DataCommunicator.java index 2819543521..43dcab0271 100644 --- a/server/src/main/java/com/vaadin/data/provider/DataCommunicator.java +++ b/server/src/main/java/com/vaadin/data/provider/DataCommunicator.java @@ -91,8 +91,7 @@ public class DataCommunicator<T> extends AbstractExtension { * that are not in the given collection will be cleaned up and * {@link DataGenerator#destroyData(Object)} will be called for them. */ - protected class ActiveDataHandler - implements DataGenerator<T> { + protected class ActiveDataHandler implements DataGenerator<T> { /** * Set of key strings for currently active data objects @@ -754,16 +753,14 @@ public class DataCommunicator<T> extends AbstractExtension { private void attachDataProviderListener() { dataProviderUpdateRegistration = getDataProvider() .addDataProviderListener(event -> { - getUI().access(() -> { - if (event instanceof DataRefreshEvent) { - T item = ((DataRefreshEvent<T>) event).getItem(); - getKeyMapper().refresh(item); - generators.forEach(g -> g.refreshData(item)); - refresh(item); - } else { - hardReset(); - } - }); + if (event instanceof DataRefreshEvent) { + T item = ((DataRefreshEvent<T>) event).getItem(); + getKeyMapper().refresh(item); + generators.forEach(g -> g.refreshData(item)); + getUI().access(() -> refresh(item)); + } else { + getUI().access(this::hardReset); + } }); } |