From 80246426e62c6b2499be6eb705dd287483bf5164 Mon Sep 17 00:00:00 2001 From: Anna Koskinen Date: Wed, 9 Jan 2013 15:03:31 +0200 Subject: Merge of (#10073) to Vaadin 7. DragDropWrapper does not work correctly with multiple batch uploads. Change-Id: Ib576ebf6f687c2b2ebda86e6ad1003408250140c --- server/src/com/vaadin/ui/DragAndDropWrapper.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'server/src/com/vaadin') diff --git a/server/src/com/vaadin/ui/DragAndDropWrapper.java b/server/src/com/vaadin/ui/DragAndDropWrapper.java index 23641f285e..6c6aa3c3f4 100644 --- a/server/src/com/vaadin/ui/DragAndDropWrapper.java +++ b/server/src/com/vaadin/ui/DragAndDropWrapper.java @@ -58,7 +58,7 @@ public class DragAndDropWrapper extends CustomComponent implements DropTarget, (String) rawVariables.get("ft" + i)); // mime String id = (String) rawVariables.get("fi" + i); files[i] = file; - receivers.put(id, file); + receivers.put(id, new ProxyReceiver(id, file)); markAsDirty(); // paint Receivers } } @@ -106,7 +106,7 @@ public class DragAndDropWrapper extends CustomComponent implements DropTarget, } - private Map receivers = new HashMap(); + private Map receivers = new HashMap(); public class WrapperTargetDetails extends TargetDetailsImpl { @@ -222,11 +222,12 @@ public class DragAndDropWrapper extends CustomComponent implements DropTarget, getDropHandler().getAcceptCriterion().paint(target); } if (receivers != null && receivers.size() > 0) { - for (Iterator> it = receivers.entrySet() - .iterator(); it.hasNext();) { - Entry entry = it.next(); + for (Iterator> it = receivers + .entrySet().iterator(); it.hasNext();) { + Entry entry = it.next(); String id = entry.getKey(); - Html5File html5File = entry.getValue(); + ProxyReceiver proxyReceiver = entry.getValue(); + Html5File html5File = proxyReceiver.file; if (html5File.getStreamVariable() != null) { target.addVariable(this, "rec-" + id, new ProxyReceiver(id, html5File)); -- cgit v1.2.3