diff options
Diffstat (limited to 'client')
-rw-r--r-- | client/src/main/java/com/vaadin/client/extensions/DragSourceExtensionConnector.java | 9 | ||||
-rw-r--r-- | client/src/main/java/com/vaadin/client/extensions/DropTargetExtensionConnector.java | 3 |
2 files changed, 11 insertions, 1 deletions
diff --git a/client/src/main/java/com/vaadin/client/extensions/DragSourceExtensionConnector.java b/client/src/main/java/com/vaadin/client/extensions/DragSourceExtensionConnector.java index 532b9877fc..b823167572 100644 --- a/client/src/main/java/com/vaadin/client/extensions/DragSourceExtensionConnector.java +++ b/client/src/main/java/com/vaadin/client/extensions/DragSourceExtensionConnector.java @@ -42,6 +42,11 @@ public class DragSourceExtensionConnector extends AbstractExtensionConnector { private static final String CLASS_DRAGGABLE = "v-draggable"; + /** + * Data type for storing drag source extension connector's ID + */ + static final String DATA_TYPE_DRAG_SOURCE_ID = "drag-source-id"; + // Create event listeners private final EventListener dragStartListener = this::onDragStart; private final EventListener dragEndListener = this::onDragEnd; @@ -104,6 +109,10 @@ public class DragSourceExtensionConnector extends AbstractExtensionConnector { nativeEvent.getDataTransfer().setData(format, data.get(format)); } + // Store the extension's connector ID in DataTransfer.data + nativeEvent.getDataTransfer() + .setData(DATA_TYPE_DRAG_SOURCE_ID, getConnectorId()); + // Initiate firing server side dragstart event when there is a // DragStartListener attached on the server side if (hasEventListener(DragSourceState.EVENT_DRAGSTART)) { diff --git a/client/src/main/java/com/vaadin/client/extensions/DropTargetExtensionConnector.java b/client/src/main/java/com/vaadin/client/extensions/DropTargetExtensionConnector.java index 3a9cbbfe84..37d62ad7c0 100644 --- a/client/src/main/java/com/vaadin/client/extensions/DropTargetExtensionConnector.java +++ b/client/src/main/java/com/vaadin/client/extensions/DropTargetExtensionConnector.java @@ -193,7 +193,8 @@ public class DropTargetExtensionConnector extends AbstractExtensionConnector { } getRpcProxy(DropTargetRpc.class) - .drop(types, data, getState().dropEffect); + .drop(types, data, getState().dropEffect, data.get( + DragSourceExtensionConnector.DATA_TYPE_DRAG_SOURCE_ID)); } removeTargetIndicator(getDropTargetElement()); |