summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMatti Tahvonen <matti.tahvonen@itmill.com>2011-09-01 07:06:17 +0000
committerMatti Tahvonen <matti.tahvonen@itmill.com>2011-09-01 07:06:17 +0000
commita8d6138ab0e42a1412d37ef151d77b8e40152271 (patch)
treec7396e5a6819e9d329c5ba606d88d76d927d0207 /tests
parentd78ba35bd3ca56d2f27a67703c834fb48acb6288 (diff)
downloadvaadin-framework-a8d6138ab0e42a1412d37ef151d77b8e40152271.tar.gz
vaadin-framework-a8d6138ab0e42a1412d37ef151d77b8e40152271.zip
#6630 improved submitUpload so that upload started listeners now trigger server side event
svn changeset:20781/svn branch:6.6
Diffstat (limited to 'tests')
-rw-r--r--tests/src/com/vaadin/tests/components/upload/ForceSubmit.java24
1 files changed, 18 insertions, 6 deletions
diff --git a/tests/src/com/vaadin/tests/components/upload/ForceSubmit.java b/tests/src/com/vaadin/tests/components/upload/ForceSubmit.java
index fef82dd962..9f5c2b67e2 100644
--- a/tests/src/com/vaadin/tests/components/upload/ForceSubmit.java
+++ b/tests/src/com/vaadin/tests/components/upload/ForceSubmit.java
@@ -5,12 +5,14 @@ import java.io.OutputStream;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.TextField;
import com.vaadin.ui.Upload;
-import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Upload.FailedEvent;
import com.vaadin.ui.Upload.FinishedEvent;
import com.vaadin.ui.Upload.Receiver;
+import com.vaadin.ui.Upload.StartedEvent;
public class ForceSubmit extends TestBase implements Receiver {
@@ -26,6 +28,9 @@ public class ForceSubmit extends TestBase implements Receiver {
@Override
protected void setup() {
+ final TextField textField = new TextField("Test field");
+ addComponent(textField);
+
final Upload u;
u = new Upload("Upload", this);
@@ -49,6 +54,13 @@ public class ForceSubmit extends TestBase implements Receiver {
}
});
+ u.addListener(new Upload.StartedListener() {
+ public void uploadStarted(StartedEvent event) {
+ getMainWindow().showNotification(
+ "Started upload. TF value :" + textField.getValue());
+ }
+ });
+
Button button = new Button(
"I'm an external button (not the uploads builtin), hit me to start upload.");
button.addListener(new ClickListener() {
@@ -63,11 +75,11 @@ public class ForceSubmit extends TestBase implements Receiver {
@Override
protected String getDescription() {
- return "Some wireframists are just so web 1.0. If requirements " +
- "say the upload must not start until the whole form " +
- "is 'Oukeyd', that is what we gotta do. In these cases " +
- "developers most probably also want to hide the uploads" +
- " internal button by setting its caption to null.";
+ return "Some wireframists are just so web 1.0. If requirements "
+ + "say the upload must not start until the whole form "
+ + "is 'Oukeyd', that is what we gotta do. In these cases "
+ + "developers most probably also want to hide the uploads"
+ + " internal button by setting its caption to null.";
}
}