summaryrefslogtreecommitdiffstats
path: root/src/com/vaadin/ui
diff options
context:
space:
mode:
authorMatti Tahvonen <matti.tahvonen@itmill.com>2010-05-07 14:55:24 +0000
committerMatti Tahvonen <matti.tahvonen@itmill.com>2010-05-07 14:55:24 +0000
commitc1608eea9df1c3409100e9ea151b6023c881577d (patch)
tree12629bbb2fc0f2cf7b618815a19955b8d2ed0cd4 /src/com/vaadin/ui
parent39ea57835c1b9eeab6f8a4cd652e8742b294ebac (diff)
downloadvaadin-framework-c1608eea9df1c3409100e9ea151b6023c881577d.tar.gz
vaadin-framework-c1608eea9df1c3409100e9ea151b6023c881577d.zip
fixes #4654, added virtual client side synchronization for UI check that happens after the upload started event
svn changeset:13085/svn branch:6.3
Diffstat (limited to 'src/com/vaadin/ui')
-rw-r--r--src/com/vaadin/ui/Upload.java23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/com/vaadin/ui/Upload.java b/src/com/vaadin/ui/Upload.java
index 49cf159e0a..0e2f022561 100644
--- a/src/com/vaadin/ui/Upload.java
+++ b/src/com/vaadin/ui/Upload.java
@@ -100,6 +100,10 @@ public class Upload extends AbstractComponent implements Component.Focusable {
private boolean interrupted = false;
+ private boolean notStarted;
+
+ private int nextid;
+
/* TODO: Add a default constructor, receive to temp file. */
/**
@@ -219,8 +223,14 @@ public class Upload extends AbstractComponent implements Component.Focusable {
*/
@Override
public void changeVariables(Object source, Map variables) {
- // NOP
-
+ if (variables.containsKey("pollForStart")) {
+ int id = (Integer) variables.get("pollForStart");
+ if (!isUploading && id == nextid) {
+ notStarted = true;
+ requestRepaint();
+ } else {
+ }
+ }
}
/**
@@ -233,6 +243,11 @@ public class Upload extends AbstractComponent implements Component.Focusable {
*/
@Override
public void paintContent(PaintTarget target) throws PaintException {
+ if (notStarted) {
+ target.addAttribute("notStarted", true);
+ notStarted = false;
+ return;
+ }
// The field should be focused
if (focus) {
target.addAttribute("focus", true);
@@ -247,7 +262,8 @@ public class Upload extends AbstractComponent implements Component.Focusable {
target.addAttribute("buttoncaption", buttonCaption);
- target.addUploadStreamVariable(this, "stream");
+ target.addAttribute("nextid", nextid);
+
}
/**
@@ -906,6 +922,7 @@ public class Upload extends AbstractComponent implements Component.Focusable {
throw new IllegalStateException("uploading already started");
}
isUploading = true;
+ nextid++;
}
/**