summaryrefslogtreecommitdiffstats
path: root/shared
diff options
context:
space:
mode:
authorHenrik Paul <henrik@vaadin.com>2014-06-18 16:04:46 +0300
committerHenrik Paul <henrik@vaadin.com>2014-06-26 13:32:23 +0300
commitf4a538019bc6c5abeeb453d9f116088d03d7c32f (patch)
tree669bd2302cde16468bd6dfe5640916ada4bf1249 /shared
parent10f7eb04e354a072a04af362f95f831f0656abf7 (diff)
downloadvaadin-framework-f4a538019bc6c5abeeb453d9f116088d03d7c32f.tar.gz
vaadin-framework-f4a538019bc6c5abeeb453d9f116088d03d7c32f.zip
Change row data type from String[] to String (#13334)
Instead of having the data type as one-string-per-column, we now have the entire row encoded as JSON Change-Id: I709b2daa88c516d98203ef463b57257a6647bacd
Diffstat (limited to 'shared')
-rw-r--r--shared/src/com/vaadin/shared/data/DataProviderRpc.java22
-rw-r--r--shared/src/com/vaadin/shared/ui/grid/GridState.java7
2 files changed, 24 insertions, 5 deletions
diff --git a/shared/src/com/vaadin/shared/data/DataProviderRpc.java b/shared/src/com/vaadin/shared/data/DataProviderRpc.java
index a2f85159ba..a92ffe0421 100644
--- a/shared/src/com/vaadin/shared/data/DataProviderRpc.java
+++ b/shared/src/com/vaadin/shared/data/DataProviderRpc.java
@@ -16,8 +16,6 @@
package com.vaadin.shared.data;
-import java.util.List;
-
import com.vaadin.shared.communication.ClientRpc;
/**
@@ -31,14 +29,28 @@ public interface DataProviderRpc extends ClientRpc {
/**
* Sends updated row data to a client.
* <p>
- * TODO rowData should be List<Object[]>
+ * rowDataJson represents a JSON array of JSON objects in the following
+ * format:
+ *
+ * <pre>
+ * [{
+ * "d": [COL_1_JSON, COL_2_json, ...]
+ * },
+ * ...
+ * ]
+ * </pre>
+ *
+ * where COL_INDEX is the index of the column (as a string), and COL_n_JSON
+ * is valid JSON of the column's data.
*
* @param firstRowIndex
* the index of the first updated row
- * @param rowData
+ * @param rowDataJson
* the updated row data
+ * @see com.vaadin.shared.ui.grid.GridState#JSONKEY_DATA
+ * @see com.vaadin.ui.components.grid.Renderer#encode(Object)
*/
- public void setRowData(int firstRowIndex, List<String[]> rowData);
+ public void setRowData(int firstRowIndex, String rowDataJson);
/**
* Informs the client to remove row data.
diff --git a/shared/src/com/vaadin/shared/ui/grid/GridState.java b/shared/src/com/vaadin/shared/ui/grid/GridState.java
index acb2a48e3c..eceaedd1fc 100644
--- a/shared/src/com/vaadin/shared/ui/grid/GridState.java
+++ b/shared/src/com/vaadin/shared/ui/grid/GridState.java
@@ -37,6 +37,13 @@ public class GridState extends AbstractComponentState {
*/
public static final double DEFAULT_HEIGHT_BY_ROWS = 10.0d;
+ /**
+ * The key in which a row's data can be found
+ * {@link com.vaadin.shared.data.DataProviderRpc#setRowData(int, List)
+ * DataProviderRpc.setRowData(int, List)}
+ */
+ public static final String JSONKEY_DATA = "d";
+
{
// FIXME Grid currently does not support undefined size
width = "400px";