Reputation:
I work with GWT and I have a FileUpload widget and a submit Button in a Form. The expected behaviour is: - When a file is attached, submit button is enabled. - When the file is dettached, submit button is disabled again. - Only .JS files will be visible during the FileUpload browsing.
Which handlers/functions should I use for these purposes?
THANKS
Upvotes: 1
Views: 1594
Reputation: 80350
Try registering aChangeHandler
:
fileUpload.addChangeHandler(new ChangeHandler{
public void onChange(ChangeEvent event) {
// filename of selected file
String fileName = fileUpload.getFilename();
}
});
Upvotes: 4