summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authormaxschuster <dev@maxschuster.eu>2016-02-22 00:10:21 +0100
committerVaadin Code Review <review@vaadin.com>2016-03-01 13:16:02 +0000
commit81aadbb9edeb4a57dd02c35937905e5427a674e0 (patch)
tree179ad1ef914d85ac90875911f915370a59032de1 /client
parentb7cb84e5b1165a913b054afa0f8bdc369cd2c031 (diff)
downloadvaadin-framework-81aadbb9edeb4a57dd02c35937905e5427a674e0.tar.gz
vaadin-framework-81aadbb9edeb4a57dd02c35937905e5427a674e0.zip
Fix DragAndDropWrapper update after file upload (#19616)
After a file has been uploaded VDragAndDropWrapper tries to pull changes from the server by calling ApplicationConnection.sendPendingVariableChanges() which has no effect. This change replaces the ApplicationConnection.sendPendingVariableChanges() call with an RPC. Change-Id: Ibdf7f4d702add9507dbe54c1fdb402f0f4b19d19
Diffstat (limited to 'client')
-rw-r--r--client/src/com/vaadin/client/ui/VDragAndDropWrapper.java15
-rw-r--r--client/src/com/vaadin/client/ui/draganddropwrapper/DragAndDropWrapperConnector.java16
2 files changed, 27 insertions, 4 deletions
diff --git a/client/src/com/vaadin/client/ui/VDragAndDropWrapper.java b/client/src/com/vaadin/client/ui/VDragAndDropWrapper.java
index f3905f9e46..a4cdd6e70f 100644
--- a/client/src/com/vaadin/client/ui/VDragAndDropWrapper.java
+++ b/client/src/com/vaadin/client/ui/VDragAndDropWrapper.java
@@ -196,6 +196,9 @@ public class VDragAndDropWrapper extends VCustomComponent implements
/** For internal use only. May be removed or replaced in the future. */
public VAbstractDropHandler dropHandler;
+ /** For internal use only. May be removed or replaced in the future. */
+ public UploadHandler uploadHandler;
+
private VDragEvent vaadinDragEvent;
int filecounter = 0;
@@ -239,9 +242,9 @@ public class VDragAndDropWrapper extends VCustomComponent implements
@Override
public void onReadyStateChange(XMLHttpRequest xhr) {
if (xhr.getReadyState() == XMLHttpRequest.DONE) {
- // visit server for possible
- // variable changes
- client.sendPendingVariableChanges();
+ // #19616 Notify the upload handler that the request is complete
+ // and let it poll the server for changes.
+ uploadHandler.uploadDone();
uploading = false;
startNextUpload();
xhr.clearOnReadyStateChange();
@@ -727,4 +730,10 @@ public class VDragAndDropWrapper extends VCustomComponent implements
return dragImageWidget;
}
+ public interface UploadHandler {
+
+ public void uploadDone();
+
+ }
+
}
diff --git a/client/src/com/vaadin/client/ui/draganddropwrapper/DragAndDropWrapperConnector.java b/client/src/com/vaadin/client/ui/draganddropwrapper/DragAndDropWrapperConnector.java
index f222721e24..7ea9596809 100644
--- a/client/src/com/vaadin/client/ui/draganddropwrapper/DragAndDropWrapperConnector.java
+++ b/client/src/com/vaadin/client/ui/draganddropwrapper/DragAndDropWrapperConnector.java
@@ -30,11 +30,18 @@ import com.vaadin.client.ui.VDragAndDropWrapper;
import com.vaadin.client.ui.customcomponent.CustomComponentConnector;
import com.vaadin.shared.ui.Connect;
import com.vaadin.shared.ui.draganddropwrapper.DragAndDropWrapperConstants;
+import com.vaadin.shared.ui.draganddropwrapper.DragAndDropWrapperServerRpc;
import com.vaadin.ui.DragAndDropWrapper;
@Connect(DragAndDropWrapper.class)
public class DragAndDropWrapperConnector extends CustomComponentConnector
- implements Paintable {
+ implements Paintable, VDragAndDropWrapper.UploadHandler {
+
+ @Override
+ protected void init() {
+ super.init();
+ getWidget().uploadHandler = this;
+ }
@Override
public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
@@ -121,4 +128,11 @@ public class DragAndDropWrapperConnector extends CustomComponentConnector
private static Logger getLogger() {
return Logger.getLogger(DragAndDropWrapperConnector.class.getName());
}
+
+ @Override
+ public void uploadDone() {
+ // #19616 RPC to poll the server for changes
+ getRpcProxy(DragAndDropWrapperServerRpc.class).poll();
+ }
+
}