summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorTeemu Suo-Anttila <teemusa@vaadin.com>2015-01-08 15:39:23 +0200
committerVaadin Code Review <review@vaadin.com>2015-01-08 14:30:21 +0000
commit329a24756347cdaf49441fcd9c8e96255fdb732e (patch)
treed84f0fbad58c8d61d5c16c5b52dd168caedbfb9e /client
parentd4e633d49441123bda15c90f4aa657bda31ee43c (diff)
downloadvaadin-framework-329a24756347cdaf49441fcd9c8e96255fdb732e.tar.gz
vaadin-framework-329a24756347cdaf49441fcd9c8e96255fdb732e.zip
Fix Grid editor hanging on exception in commit (#15536)
This patch adds a minimal editor subpart support. Change-Id: I36a81cb432f71821715cb60338a07a289bdae18d
Diffstat (limited to 'client')
-rw-r--r--client/src/com/vaadin/client/widgets/Grid.java31
1 files changed, 31 insertions, 0 deletions
diff --git a/client/src/com/vaadin/client/widgets/Grid.java b/client/src/com/vaadin/client/widgets/Grid.java
index 8c1b833acc..1bca9e84ae 100644
--- a/client/src/com/vaadin/client/widgets/Grid.java
+++ b/client/src/com/vaadin/client/widgets/Grid.java
@@ -121,6 +121,7 @@ import com.vaadin.client.widget.grid.sort.SortEvent;
import com.vaadin.client.widget.grid.sort.SortHandler;
import com.vaadin.client.widget.grid.sort.SortOrder;
import com.vaadin.client.widgets.Escalator.AbstractRowContainer;
+import com.vaadin.client.widgets.Grid.Editor.State;
import com.vaadin.shared.data.sort.SortDirection;
import com.vaadin.shared.ui.grid.GridConstants;
import com.vaadin.shared.ui.grid.GridStaticCellType;
@@ -4766,6 +4767,20 @@ public class Grid<T> extends ResizeComposite implements
container = escalator.getBody();
} else if (type.equalsIgnoreCase("footer")) {
container = escalator.getFooter();
+ } else if (type.equalsIgnoreCase("editor")) {
+ if (editor.getState() != State.ACTIVE) {
+ // Editor is not there.
+ return null;
+ }
+
+ if (indices.length == 0) {
+ return DOM.asOld(editor.editorOverlay);
+ } else if (indices.length == 1 && indices[0] < columns.size()) {
+ escalator.scrollToColumn(indices[0], ScrollDestination.ANY, 0);
+ return editor.getWidget(columns.get(indices[0])).getElement();
+ } else {
+ return null;
+ }
}
if (null != container) {
@@ -4851,6 +4866,22 @@ public class Grid<T> extends ResizeComposite implements
+ (containerRow ? "]" : "][" + cell.getColumn() + "]");
}
}
+
+ // Check if subelement is part of editor.
+ if (editor.getState() == State.ACTIVE) {
+ if (editor.editorOverlay.isOrHasChild(subElement)) {
+ int i = 0;
+ for (Column<?, T> column : columns) {
+ if (editor.getWidget(column).getElement()
+ .isOrHasChild(subElement)) {
+ return "editor[" + i + "]";
+ }
+ ++i;
+ }
+ return "editor";
+ }
+ }
+
return null;
}