diff options
author | Anastasia Smirnova <anasmi@utu.fi> | 2018-11-15 08:56:40 +0200 |
---|---|---|
committer | Sun Zhe <31067185+ZheSun88@users.noreply.github.com> | 2018-11-15 08:56:40 +0200 |
commit | 55864a333a053d7a70dafa235bd5f236d641319f (patch) | |
tree | 8df129247b159dda99f79901b1f65295c4c8692d /server | |
parent | 522e16ab150740aec847c2044fc50d10f5388ac7 (diff) | |
download | vaadin-framework-55864a333a053d7a70dafa235bd5f236d641319f.tar.gz vaadin-framework-55864a333a053d7a70dafa235bd5f236d641319f.zip |
Refactoring DataCommunicator code (#11304)
This refactoring addresses two issues cased by dropping updatedData before it was processed. Issues arise , when visibility has change.
Fixes #11274 and similar issue within RadioButton
There is no reliable way to test automatically NativeSelects in Grid, but adding UI test, at least
Diffstat (limited to 'server')
-rw-r--r-- | server/src/main/java/com/vaadin/data/provider/DataCommunicator.java | 18 |
1 files changed, 9 insertions, 9 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 bb76d7cdcb..449cbc5711 100644 --- a/server/src/main/java/com/vaadin/data/provider/DataCommunicator.java +++ b/server/src/main/java/com/vaadin/data/provider/DataCommunicator.java @@ -358,6 +358,15 @@ public class DataCommunicator<T> extends AbstractExtension { rpc.reset(getDataProviderSize()); } + if (!updatedData.isEmpty()) { + JsonArray dataArray = Json.createArray(); + int i = 0; + for (T data : updatedData) { + dataArray.set(i++, getDataObject(data)); + } + rpc.updateData(dataArray); + } + Range requestedRows = getPushRows(); boolean triggerReset = false; if (!requestedRows.isEmpty()) { @@ -373,15 +382,6 @@ public class DataCommunicator<T> extends AbstractExtension { pushData(offset, rowsToPush); } - if (!updatedData.isEmpty()) { - JsonArray dataArray = Json.createArray(); - int i = 0; - for (T data : updatedData) { - dataArray.set(i++, getDataObject(data)); - } - rpc.updateData(dataArray); - } - setPushRows(Range.withLength(0, 0)); reset = triggerReset; updatedData.clear(); |