summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorTeemu Suo-Anttila <tsuoanttila@users.noreply.github.com>2018-01-25 14:36:51 +0200
committerTeemu Suo-Anttila <tsuoanttila@users.noreply.github.com>2018-01-31 14:27:32 +0200
commit8bc470f4404d21a65520d4eae50b434dbe92985a (patch)
tree482c9cf96339fdd64a638f8118519490b263acb6 /server
parent5c9fc0f1ebd1e25fd36ad28af90cbadbb5b3adb5 (diff)
downloadvaadin-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.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);
+ }
});
}