Also, in our application we just provide dummy new
ListModel<FileUpload>() to each FileUpload constructor, never reading
the ListModel ourselves... Is there any reason why we just don't set
it ourselves? What is the usecase of binding the FileUploadField to a
property?

Martijn

On Fri, Jun 17, 2011 at 2:43 PM, Martijn Dashorst
<[email protected]> wrote:
> 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
>



-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com

Reply via email to