FileUpload now supports (for HTML5 capable browsers) multiple files.
The problem is that this breaks API for all users of FileUpload. I'd
like to propose the following:
class AbstractFileUploadField <T> extends FormComponent<T> {
protected List<FileUpload> getFileUploads() { extract uploads from
multipart request }
}
class FileUploadField extends AbstractFileUploadField<T> {
public FileUpload getFileUpload() { return super.getFileUploads().get(0); }
}
class MultiFileUploadField extends AbstractFileUploadField<List<FileUpload> > {
public List<FileUpload> getFileUploads() { return super.getFileUploads(); }
}
And move the current JS based MultiFileUpload to extensions, or even
to github (minis?), or merge the JS based solution with the HTML5
variant as a fallback.
This does feel a bit engineered. Another proposal I could live by is
to just remove FileUploadField.getFileUpload() (the singular variant),
to make the API consistent.
Martijn
--
Become a Wicket expert, learn from the best: http://wicketinaction.com