开发者

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜