summaryrefslogtreecommitdiffstats
path: root/server/src
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2015-06-18 21:59:51 +0300
committerHenri Sara <hesara@vaadin.com>2015-07-04 14:29:57 +0300
commit7f7620fe1c5b3c956545ae7fe0f9ecaa08090473 (patch)
tree4d98e5edf5ef6bae1da28d40d4e006e23fa19eb9 /server/src
parent70e91f4f165cc3b535b530754ecf728096ec70fc (diff)
downloadvaadin-framework-7f7620fe1c5b3c956545ae7fe0f9ecaa08090473.tar.gz
vaadin-framework-7f7620fe1c5b3c956545ae7fe0f9ecaa08090473.zip
Properly toggle editor state when calling editId() on the server
(#18287) Ensure isEditorActive() returns false if editItem(...) has been called but the editor has not yet been opened, as it should according to javadoc isRendered() requires that the editor fields are marked as dirty when they are made visible on the client (isEditorActive() changes state) Change-Id: I7123332c6769f7a7f6b00852bddc8dbbaa311754
Diffstat (limited to 'server/src')
-rw-r--r--server/src/com/vaadin/ui/Grid.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/server/src/com/vaadin/ui/Grid.java b/server/src/com/vaadin/ui/Grid.java
index 88a3195857..e5eebff879 100644
--- a/server/src/com/vaadin/ui/Grid.java
+++ b/server/src/com/vaadin/ui/Grid.java
@@ -3533,6 +3533,7 @@ public class Grid extends AbstractComponent implements SelectionNotifier,
private final Footer footer = new Footer(this);
private Object editedItemId = null;
+ private boolean editorActive = false;
private FieldGroup editorFieldGroup = new CustomFieldGroup();
private CellStyleGenerator cellStyleGenerator;
@@ -5691,7 +5692,7 @@ public class Grid extends AbstractComponent implements SelectionNotifier,
* @return true iff the editor is open
*/
public boolean isEditorActive() {
- return editedItemId != null;
+ return editorActive;
}
private void checkColumnExists(Object propertyId) {
@@ -5765,6 +5766,7 @@ public class Grid extends AbstractComponent implements SelectionNotifier,
.getPropertyId());
}
+ editorActive = true;
// Must ensure that all fields, recursively, are sent to the client
// This is needed because the fields are hidden using isRendered
for (Field<?> f : getEditorFields()) {
@@ -5816,6 +5818,7 @@ public class Grid extends AbstractComponent implements SelectionNotifier,
protected void doCancelEditor() {
editedItemId = null;
+ editorActive = false;
editorFieldGroup.discard();
editorFieldGroup.setItemDataSource(null);
}
@@ -5833,6 +5836,7 @@ public class Grid extends AbstractComponent implements SelectionNotifier,
}
editedItemId = null;
+ editorActive = false;
editorFieldGroup = new CustomFieldGroup();
}