From 9d42af60ad77b5cf1ad619af4630d1206ad0025c Mon Sep 17 00:00:00 2001 From: Teemu Suo-Anttila Date: Thu, 4 Feb 2016 15:45:40 +0200 Subject: Fix key and active data mapping when adding a data object Change-Id: Ibfaf4b62673c008b94e039deb77f6f6d73d83753 --- .../com/vaadin/client/connectors/data/typed/DataSourceConnector.java | 1 + .../com/vaadin/server/communication/data/typed/SimpleDataProvider.java | 2 ++ 2 files changed, 3 insertions(+) diff --git a/client/src/com/vaadin/client/connectors/data/typed/DataSourceConnector.java b/client/src/com/vaadin/client/connectors/data/typed/DataSourceConnector.java index 8f9527c8e0..b63bf6e281 100644 --- a/client/src/com/vaadin/client/connectors/data/typed/DataSourceConnector.java +++ b/client/src/com/vaadin/client/connectors/data/typed/DataSourceConnector.java @@ -88,6 +88,7 @@ public class DataSourceConnector extends AbstractExtensionConnector { @Override public void add(JsonObject dataObject) { ds.asList().add(dataObject); + keyToJson.put(getKey(dataObject), dataObject); } @Override diff --git a/server/src/com/vaadin/server/communication/data/typed/SimpleDataProvider.java b/server/src/com/vaadin/server/communication/data/typed/SimpleDataProvider.java index 9fba28e59a..91a7772ae3 100644 --- a/server/src/com/vaadin/server/communication/data/typed/SimpleDataProvider.java +++ b/server/src/com/vaadin/server/communication/data/typed/SimpleDataProvider.java @@ -15,6 +15,7 @@ */ package com.vaadin.server.communication.data.typed; +import java.util.Collections; import java.util.HashSet; import java.util.Set; @@ -138,6 +139,7 @@ public class SimpleDataProvider extends DataProvider { */ protected void add(T data) { rpc.add(getDataObject(data)); + handler.addActiveData(Collections.singleton(data)); } /** -- cgit v1.2.3