summaryrefslogtreecommitdiffstats
path: root/shared
diff options
context:
space:
mode:
authorJohannes Dahlström <johannesd@vaadin.com>2014-09-17 19:22:37 +0300
committerVaadin Code Review <review@vaadin.com>2014-10-07 11:51:58 +0000
commit59624acfcf91ec6e82e966942d438707be6ca26c (patch)
tree58c9303314f22227c7a16d4b0186231e03930d7b /shared
parent5b3c9bc4ebfcb2837b07327b81831e81db2deccc (diff)
downloadvaadin-framework-59624acfcf91ec6e82e966942d438707be6ca26c.tar.gz
vaadin-framework-59624acfcf91ec6e82e966942d438707be6ca26c.zip
Implement Vaadin-specific editor row commit/discard handling (#13334)
Change-Id: Iaaf5e4461adb1d4fd9b8f042c6001b8408d1a0e4
Diffstat (limited to 'shared')
-rw-r--r--shared/src/com/vaadin/shared/ui/grid/EditorRowClientRpc.java14
-rw-r--r--shared/src/com/vaadin/shared/ui/grid/EditorRowServerRpc.java19
2 files changed, 33 insertions, 0 deletions
diff --git a/shared/src/com/vaadin/shared/ui/grid/EditorRowClientRpc.java b/shared/src/com/vaadin/shared/ui/grid/EditorRowClientRpc.java
index 1c99a5035d..d6822cfccc 100644
--- a/shared/src/com/vaadin/shared/ui/grid/EditorRowClientRpc.java
+++ b/shared/src/com/vaadin/shared/ui/grid/EditorRowClientRpc.java
@@ -34,6 +34,14 @@ public interface EditorRowClientRpc extends ClientRpc {
void bind(int rowIndex);
/**
+ * Tells the client to discard unsaved changes in the editor row.
+ *
+ * @param rowIndex
+ * the index of the edited row
+ */
+ void discard(int rowIndex);
+
+ /**
* Tells the client to cancel editing and hide the editor row.
*
* @param rowIndex
@@ -46,4 +54,10 @@ public interface EditorRowClientRpc extends ClientRpc {
* by the client.
*/
void confirmBind();
+
+ /**
+ * Confirms a pending {@link EditorRowServerRpc#commit(int) commit request}
+ * sent by the client.
+ */
+ void confirmCommit();
}
diff --git a/shared/src/com/vaadin/shared/ui/grid/EditorRowServerRpc.java b/shared/src/com/vaadin/shared/ui/grid/EditorRowServerRpc.java
index 45705ca924..25bafe2da1 100644
--- a/shared/src/com/vaadin/shared/ui/grid/EditorRowServerRpc.java
+++ b/shared/src/com/vaadin/shared/ui/grid/EditorRowServerRpc.java
@@ -37,6 +37,25 @@ public interface EditorRowServerRpc extends ServerRpc {
void bind(int rowIndex);
/**
+ * Asks the server to commit unsaved changes in the editor row to the data
+ * source. When a commit request is sent, it must be acknowledged with a
+ * {@link EditorRowClientRpc#confirmCommit() confirm call}.
+ *
+ * @param rowIndex
+ * the index of the edited row
+ */
+ void commit(int rowIndex);
+
+ /**
+ * Asks the server to replace any unsaved changes with values from the data
+ * source.
+ *
+ * @param rowIndex
+ * the index of the edited row
+ */
+ void discard(int rowIndex);
+
+ /**
* Tells the server to cancel editing. When sending a cancel request, the
* client does not need to wait for confirmation by the server before hiding
* the editor row.