summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorTeemu Suo-Anttila <tsuoanttila@users.noreply.github.com>2018-01-25 14:36:51 +0200
committerIlia Motornyi <elmot@vaadin.com>2018-01-25 14:36:51 +0200
commit2f6f2970bc8ea8bb7d4745b9e87255874ef9fb5e (patch)
tree67fd727ae9e58932ebc3fec2fa4d46c6b4fac15c /server
parentcf0d3dcc5ad32285b91e7d998cf628ef9c83da55 (diff)
downloadvaadin-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.java21
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);
+ }
});
}