summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorMarc Englund <marc@vaadin.com>2013-05-24 17:19:51 +0300
committerVaadin Code Review <review@vaadin.com>2013-06-05 09:19:07 +0000
commit08ba394b1199797e3f0be7efead66e0b5393b5c3 (patch)
treeb7f3259cef66dfa7517585255cd31c39b7117dfe /server
parentd647d7a48a70cf6d4d86500311e235e0778c7dab (diff)
downloadvaadin-framework-08ba394b1199797e3f0be7efead66e0b5393b5c3.tar.gz
vaadin-framework-08ba394b1199797e3f0be7efead66e0b5393b5c3.zip
Disable drag&drop when source or target component is disabled, re-implementation of 6.8 fix for #11801
Change-Id: Iacd167ad7075620dae59ff2c7789efaf32521c59
Diffstat (limited to 'server')
-rw-r--r--server/src/com/vaadin/server/DragAndDropService.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/server/src/com/vaadin/server/DragAndDropService.java b/server/src/com/vaadin/server/DragAndDropService.java
index 5a54b5ae3a..38c055eb1a 100644
--- a/server/src/com/vaadin/server/DragAndDropService.java
+++ b/server/src/com/vaadin/server/DragAndDropService.java
@@ -64,6 +64,16 @@ public class DragAndDropService implements VariableOwner, ClientConnector {
public void changeVariables(Object source, Map<String, Object> variables) {
Object owner = variables.get("dhowner");
+ final Component sourceComponent = (Component) variables
+ .get("component");
+ if (sourceComponent != null && !sourceComponent.isEnabled()) {
+ // source component not supposed to be enabled
+ getLogger().warning(
+ "Client dropped from " + sourceComponent
+ + " even though it's disabled");
+ return;
+ }
+
// Validate drop handler owner
if (!(owner instanceof DropTarget)) {
getLogger()
@@ -74,6 +84,15 @@ public class DragAndDropService implements VariableOwner, ClientConnector {
// owner cannot be null here
DropTarget dropTarget = (DropTarget) owner;
+
+ if (!dropTarget.isEnabled()) {
+ getLogger()
+ .warning(
+ "Client dropped on " + owner
+ + " even though it's disabled");
+ return;
+ }
+
lastVisitId = (Integer) variables.get("visitId");
// request may be dropRequest or request during drag operation (commonly