aboutsummaryrefslogtreecommitdiffstats
path: root/server/src
diff options
context:
space:
mode:
authorHenrik Paul <henrik@vaadin.com>2015-01-09 14:59:13 +0200
committerTeemu Suo-Anttila <teemusa@vaadin.com>2015-01-15 13:57:26 +0000
commit8e4b607730fc9ee30519c21779a99cef6440831c (patch)
tree1d6349045d8ea3259e7fd98fa4e2197a8eb67412 /server/src
parent0723f355464c0a9093a8c9d43542b13a6aa9d366 (diff)
downloadvaadin-framework-8e4b607730fc9ee30519c21779a99cef6440831c.tar.gz
vaadin-framework-8e4b607730fc9ee30519c21779a99cef6440831c.zip
Adds error handling to Grid Editor (#15556)
Change-Id: I93551548aad280c4e0193d65a066976d40d65a86
Diffstat (limited to 'server/src')
-rw-r--r--server/src/com/vaadin/ui/Grid.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/server/src/com/vaadin/ui/Grid.java b/server/src/com/vaadin/ui/Grid.java
index 18d45b3b9f..bddbd7c731 100644
--- a/server/src/com/vaadin/ui/Grid.java
+++ b/server/src/com/vaadin/ui/Grid.java
@@ -2732,13 +2732,16 @@ public class Grid extends AbstractComponent implements SelectionNotifier,
@Override
public void bind(int rowIndex) {
+ boolean success;
try {
Object id = getContainerDataSource().getIdByIndex(rowIndex);
doEditItem(id);
+ success = true;
} catch (Exception e) {
handleError(e);
+ success = false;
}
- getEditorRpc().confirmBind();
+ getEditorRpc().confirmBind(success);
}
@Override
@@ -2753,12 +2756,15 @@ public class Grid extends AbstractComponent implements SelectionNotifier,
@Override
public void save(int rowIndex) {
+ boolean success;
try {
saveEditor();
+ success = true;
} catch (Exception e) {
handleError(e);
+ success = false;
}
- getEditorRpc().confirmSave();
+ getEditorRpc().confirmSave(success);
}
private void handleError(Exception e) {