aboutsummaryrefslogtreecommitdiffstats
path: root/server/src
diff options
context:
space:
mode:
authorTomi Virtanen <tltv@vaadin.com>2013-12-09 13:44:27 +0200
committerVaadin Code Review <review@vaadin.com>2014-01-07 09:27:08 +0000
commit0579fba63048ffa8daa22db5243a149e67f73594 (patch)
treeb59603dcbe436e2c5433e44120bfabe3881dd915 /server/src
parent0b95f8d6f6e3f278b51c0242e8ce2dfc82ed829e (diff)
downloadvaadin-framework-0579fba63048ffa8daa22db5243a149e67f73594.tar.gz
vaadin-framework-0579fba63048ffa8daa22db5243a149e67f73594.zip
Upload control with empty selection (#9602)
Event is now sent on submit even if no file is selected. Removed forceSubmit UIDL attribute and replaced it with a UploadClientRpc call. Added TestBench3 test. Change-Id: Id32b82532ec34e61a9c0718413fd1755015d2c30
Diffstat (limited to 'server/src')
-rw-r--r--server/src/com/vaadin/ui/Upload.java14
1 files changed, 2 insertions, 12 deletions
diff --git a/server/src/com/vaadin/ui/Upload.java b/server/src/com/vaadin/ui/Upload.java
index 08cabf979a..98f5d2ded9 100644
--- a/server/src/com/vaadin/ui/Upload.java
+++ b/server/src/com/vaadin/ui/Upload.java
@@ -28,6 +28,7 @@ import com.vaadin.server.NoOutputStreamException;
import com.vaadin.server.PaintException;
import com.vaadin.server.PaintTarget;
import com.vaadin.server.StreamVariable.StreamingProgressEvent;
+import com.vaadin.shared.ui.upload.UploadClientRpc;
/**
* Component for uploading files from client to server.
@@ -107,11 +108,6 @@ public class Upload extends AbstractComponent implements Component.Focusable,
private int nextid;
/**
- * Flag to indicate that submitting file has been requested.
- */
- private boolean forceSubmit;
-
- /**
* Creates a new instance of Upload.
*
* The receiver must be set before performing an upload.
@@ -157,11 +153,6 @@ public class Upload extends AbstractComponent implements Component.Focusable,
notStarted = false;
return;
}
- if (forceSubmit) {
- target.addAttribute("forceSubmit", true);
- forceSubmit = true;
- return;
- }
// The field should be focused
if (focus) {
target.addAttribute("focus", true);
@@ -1011,12 +1002,11 @@ public class Upload extends AbstractComponent implements Component.Focusable,
*/
public void submitUpload() {
markAsDirty();
- forceSubmit = true;
+ getRpcProxy(UploadClientRpc.class).submitUpload();
}
@Override
public void markAsDirty() {
- forceSubmit = false;
super.markAsDirty();
}