diff options
author | Anna Koskinen <anna@vaadin.com> | 2013-01-09 15:03:31 +0200 |
---|---|---|
committer | Anna Koskinen <anna@vaadin.com> | 2013-01-09 15:03:31 +0200 |
commit | 80246426e62c6b2499be6eb705dd287483bf5164 (patch) | |
tree | 180ca7d3e323f1bfee0790303cd7ba13c95fd827 /client | |
parent | 3c0ade1825e580d370d31e8748423d6beb0fa0f3 (diff) | |
download | vaadin-framework-80246426e62c6b2499be6eb705dd287483bf5164.tar.gz vaadin-framework-80246426e62c6b2499be6eb705dd287483bf5164.zip |
Merge of (#10073) to Vaadin 7.
DragDropWrapper does not work correctly with multiple batch uploads.
Change-Id: Ib576ebf6f687c2b2ebda86e6ad1003408250140c
Diffstat (limited to 'client')
-rw-r--r-- | client/src/com/vaadin/client/ui/VDragAndDropWrapper.java | 2 | ||||
-rw-r--r-- | client/src/com/vaadin/client/ui/draganddropwrapper/DragAndDropWrapperConnector.java | 12 |
2 files changed, 14 insertions, 0 deletions
diff --git a/client/src/com/vaadin/client/ui/VDragAndDropWrapper.java b/client/src/com/vaadin/client/ui/VDragAndDropWrapper.java index 91edcc4db1..f23bf88969 100644 --- a/client/src/com/vaadin/client/ui/VDragAndDropWrapper.java +++ b/client/src/com/vaadin/client/ui/VDragAndDropWrapper.java @@ -373,6 +373,8 @@ public class VDragAndDropWrapper extends VCustomComponent implements for (int i = 0; i < fileCount; i++) { final int fileId = filecounter++; final VHtml5File file = event.getFile(i); + VConsole.log("Preparing to upload file " + file.getName() + + " with id " + fileId); transferable.setData("fi" + i, "" + fileId); transferable.setData("fn" + i, file.getName()); transferable.setData("ft" + i, file.getType()); diff --git a/client/src/com/vaadin/client/ui/draganddropwrapper/DragAndDropWrapperConnector.java b/client/src/com/vaadin/client/ui/draganddropwrapper/DragAndDropWrapperConnector.java index 60b9690321..f659e72e78 100644 --- a/client/src/com/vaadin/client/ui/draganddropwrapper/DragAndDropWrapperConnector.java +++ b/client/src/com/vaadin/client/ui/draganddropwrapper/DragAndDropWrapperConnector.java @@ -21,6 +21,7 @@ import java.util.Set; import com.vaadin.client.ApplicationConnection; import com.vaadin.client.Paintable; import com.vaadin.client.UIDL; +import com.vaadin.client.VConsole; import com.vaadin.client.ui.VDragAndDropWrapper; import com.vaadin.client.ui.customcomponent.CustomComponentConnector; import com.vaadin.shared.ui.Connect; @@ -61,6 +62,17 @@ public class DragAndDropWrapperConnector extends CustomComponentConnector getWidget().fileIds.remove(indexOf); } } else { + if (getWidget().fileIdToReceiver.containsKey(fileId) + && receiverUrl != null + && !receiverUrl + .equals(getWidget().fileIdToReceiver + .get(fileId))) { + VConsole.error("Overwriting file receiver mapping for fileId " + + fileId + + " . Old receiver URL: " + + getWidget().fileIdToReceiver.get(fileId) + + " New receiver URL: " + receiverUrl); + } getWidget().fileIdToReceiver.put(fileId, receiverUrl); } } |