FileUpload handler to enable submit button
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.
开发者_Go百科Which handlers/functions should I use for these purposes?
THANKS
Try registering aChangeHandler
:
fileUpload.addChangeHandler(new ChangeHandler{
public void onChange(ChangeEvent event) {
// filename of selected file
String fileName = fileUpload.getFilename();
}
});
精彩评论