summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--client/src/com/vaadin/client/connectors/RpcDataSourceConnector.java9
-rw-r--r--server/src/com/vaadin/data/RpcDataProviderExtension.java4
-rw-r--r--shared/build.xml4
-rw-r--r--shared/src/com/vaadin/shared/data/DataProviderRpc.java4
4 files changed, 9 insertions, 12 deletions
diff --git a/client/src/com/vaadin/client/connectors/RpcDataSourceConnector.java b/client/src/com/vaadin/client/connectors/RpcDataSourceConnector.java
index 74c8dfb02f..f8d6ebcb62 100644
--- a/client/src/com/vaadin/client/connectors/RpcDataSourceConnector.java
+++ b/client/src/com/vaadin/client/connectors/RpcDataSourceConnector.java
@@ -30,8 +30,6 @@ import com.vaadin.shared.ui.grid.Range;
import elemental.json.Json;
import elemental.json.JsonArray;
import elemental.json.JsonObject;
-import elemental.json.JsonType;
-import elemental.json.JsonValue;
/**
* Connects a Vaadin server-side container data source to a Grid. This is
@@ -50,12 +48,7 @@ public class RpcDataSourceConnector extends AbstractExtensionConnector {
protected RpcDataSource() {
registerRpc(DataProviderRpc.class, new DataProviderRpc() {
@Override
- public void setRowData(int firstRow, String rowsJson) {
- JsonValue parsedJson = Json.instance().parse(rowsJson);
- assert parsedJson.getType() == JsonType.ARRAY : "Was unable to parse JSON into an array: "
- + parsedJson;
- JsonArray rowArray = (JsonArray) parsedJson;
-
+ public void setRowData(int firstRow, JsonArray rowArray) {
ArrayList<JsonObject> rows = new ArrayList<JsonObject>(
rowArray.length());
for (int i = 0; i < rowArray.length(); i++) {
diff --git a/server/src/com/vaadin/data/RpcDataProviderExtension.java b/server/src/com/vaadin/data/RpcDataProviderExtension.java
index 2008988ce2..48ef8d754f 100644
--- a/server/src/com/vaadin/data/RpcDataProviderExtension.java
+++ b/server/src/com/vaadin/data/RpcDataProviderExtension.java
@@ -767,7 +767,7 @@ public class RpcDataProviderExtension extends AbstractExtension {
for (int i = 0; i < itemIds.size(); ++i) {
rows.set(i, getRowData(getGrid().getColumns(), itemIds.get(i)));
}
- rpc.setRowData(firstRowToPush, rows.toJson());
+ rpc.setRowData(firstRowToPush, rows);
activeRowHandler.setActiveRows(active.getStart(), active.length());
}
@@ -900,7 +900,7 @@ public class RpcDataProviderExtension extends AbstractExtension {
JsonValue row = getRowData(getGrid().getColumns(), itemId);
JsonArray rowArray = Json.createArray();
rowArray.set(0, row);
- rpc.setRowData(index, rowArray.toJson());
+ rpc.setRowData(index, rowArray);
}
/**
diff --git a/shared/build.xml b/shared/build.xml
index 8e2f6bc15e..42e9952217 100644
--- a/shared/build.xml
+++ b/shared/build.xml
@@ -16,7 +16,9 @@
<property name="result.dir" location="result" />
<property name="src.filtered" location="${result.dir}/filtered-src" />
<property name="src" location="${src.filtered}" />
- <path id="classpath.compile.custom" />
+ <path id="classpath.compile.custom">
+ <fileset file="${gwt.elemental.jar}" />
+ </path>
<path id="classpath.test.custom" />
<target name="jar">
diff --git a/shared/src/com/vaadin/shared/data/DataProviderRpc.java b/shared/src/com/vaadin/shared/data/DataProviderRpc.java
index 4bf4f3af5b..4bfdb8b6c5 100644
--- a/shared/src/com/vaadin/shared/data/DataProviderRpc.java
+++ b/shared/src/com/vaadin/shared/data/DataProviderRpc.java
@@ -19,6 +19,8 @@ package com.vaadin.shared.data;
import com.vaadin.shared.annotations.NoLayout;
import com.vaadin.shared.communication.ClientRpc;
+import elemental.json.JsonArray;
+
/**
* RPC interface used for pushing container data to the client.
*
@@ -53,7 +55,7 @@ public interface DataProviderRpc extends ClientRpc {
* @see com.vaadin.ui.components.grid.Renderer#encode(Object)
*/
@NoLayout
- public void setRowData(int firstRowIndex, String rowDataJson);
+ public void setRowData(int firstRowIndex, JsonArray rowDataJson);
/**
* Informs the client to remove row data.