aboutsummaryrefslogtreecommitdiffstats
path: root/client/src
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2014-02-03 21:46:06 +0200
committerArtur Signell <artur@vaadin.com>2014-02-21 12:19:41 +0200
commit09969ce1fedb3dc9cca863c393735f64bfbbedc1 (patch)
tree381fd4f2d1b5f0cf2db4b82d97b8017547ec1e7f /client/src
parentde70ee2f0132661c9bf771cb66a40d1961073037 (diff)
downloadvaadin-framework-09969ce1fedb3dc9cca863c393735f64bfbbedc1.tar.gz
vaadin-framework-09969ce1fedb3dc9cca863c393735f64bfbbedc1.zip
Add change event for Upload (#13222)
Change-Id: I9850888b1997104cbc493ae0882316a9d2b1cedd
Diffstat (limited to 'client/src')
-rw-r--r--client/src/com/vaadin/client/ui/upload/UploadConnector.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/client/src/com/vaadin/client/ui/upload/UploadConnector.java b/client/src/com/vaadin/client/ui/upload/UploadConnector.java
index 989a913adc..03f1a2802c 100644
--- a/client/src/com/vaadin/client/ui/upload/UploadConnector.java
+++ b/client/src/com/vaadin/client/ui/upload/UploadConnector.java
@@ -16,13 +16,17 @@
package com.vaadin.client.ui.upload;
+import com.google.gwt.event.dom.client.ChangeEvent;
+import com.google.gwt.event.dom.client.ChangeHandler;
import com.vaadin.client.ApplicationConnection;
import com.vaadin.client.Paintable;
import com.vaadin.client.UIDL;
import com.vaadin.client.ui.AbstractComponentConnector;
import com.vaadin.client.ui.VUpload;
+import com.vaadin.shared.EventId;
import com.vaadin.shared.ui.Connect;
import com.vaadin.shared.ui.upload.UploadClientRpc;
+import com.vaadin.shared.ui.upload.UploadServerRpc;
import com.vaadin.ui.Upload;
@Connect(Upload.class)
@@ -39,6 +43,21 @@ public class UploadConnector extends AbstractComponentConnector implements
}
@Override
+ protected void init() {
+ super.init();
+
+ getWidget().fu.addChangeHandler(new ChangeHandler() {
+ @Override
+ public void onChange(ChangeEvent event) {
+ if (hasEventListener(EventId.CHANGE)) {
+ getRpcProxy(UploadServerRpc.class).change(
+ getWidget().fu.getFilename());
+ }
+ }
+ });
+ }
+
+ @Override
public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
if (!isRealUpdate(uidl)) {
return;