diff options
author | Teemu Suo-Anttila <tsuoanttila@users.noreply.github.com> | 2018-01-25 14:36:51 +0200 |
---|---|---|
committer | Teemu Suo-Anttila <tsuoanttila@users.noreply.github.com> | 2018-01-31 14:27:32 +0200 |
commit | 8bc470f4404d21a65520d4eae50b434dbe92985a (patch) | |
tree | 482c9cf96339fdd64a638f8118519490b263acb6 /server | |
parent | 5c9fc0f1ebd1e25fd36ad28af90cbadbb5b3adb5 (diff) | |
download | vaadin-framework-8bc470f4404d21a65520d4eae50b434dbe92985a.tar.gz vaadin-framework-8bc470f4404d21a65520d4eae50b434dbe92985a.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); + } }); } |