@Point 1: I think itβs not possible to filter which files can be selected. The only way for me is to compare in the form handler, for example:
form.addFormHandler(new FormHandler(){
public void onSubmit(FormSubmitEvent event){
if(!extension.equals("pdf")) {
} else {
}
}
}
Another solution is to use ExtGWT with FileValidator:
fileUpload = new FileUploadField();
fileUpload.setWidth("240");
fileUpload.setValidator(new FileValidator());
fileUpload.setName("file");
fileUpload.setAccept("pdf");
@Point 2: chooser.isAttached() imho.... , .