iamtheexp01
iamtheexp01

Reputation: 3466

Vaadin : Upload button listener

How can I get the upload button listener of component upload? This is because I want to validate other fields upon clicking the upload button. I've tried adding...

upload.addListener(new Upload.StartedListener() {});

It only works if there is already a chosen file but if the file is blank, it didn't.

Upvotes: 3

Views: 3006

Answers (2)

Chetan Patil
Chetan Patil

Reputation: 21

No need to hide the 'Upload' Button with CSS.

Another simple way to hide:

Upload upload = new Upload("Caption", receiver);

upload.setButtonCaption(null);//will hide the Upload Button 

Upvotes: 2

Henri Kerola
Henri Kerola

Reputation: 4967

Try to hide the submit button of Upload with CSS and create a button that calls:

upload.submitUpload();

Upvotes: 2

Related Questions