开发者

FileUpload handler to enable submit button

开发者 https://www.devze.com 2023-03-27 03:58 出处:网络
I work with GWT and I have a FileUpload widget and a submit Button in a Form. The expected behaviour is:

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();
    }
});
0

精彩评论

暂无评论...
验证码 换一张
取 消