Issue Details (XML | Word | Printable)

Type: New Feature New Feature
Status: Open Open
Priority: Minor Minor
Assignee: Unassigned
Reporter: Ed Burns
Votes: 1
Watchers: 1

If you were logged in you would be able to see more operations.

Support multiple attribute on h:inputFile

Created: 10/Jun/13 10:02 PM   Updated: 08/Nov/13 09:15 PM
Component/s: Components/Renderers
Affects Version/s: 2.2
Fix Version/s: None

Time Tracking:
Original Estimate: 3 days
Original Estimate - 3 days
Remaining Estimate: 3 days
Remaining Estimate - 3 days
Time Spent: Not Specified
Time Spent - Not Specified

Issue Links:

Participants: Ed Burns

 Description  « Hide

HTML 5 has a new attribute on input file: multiple.

When present, the user agent must allow the file chooser to select multiple files.

While the pass through attributes feature allows this to render correctly:

<html xmlns=""

    <h:form id="form" enctype="multipart/form-data" prependId="false">
        <p><h:inputFile id="file" value="#{fileUploadBean.uploadedFile}" p:multiple="multiple"> 
             <f:validator validatorId="FileValidator" />

The renderer for javax.faces.Input javax.faces.File doesn't handle this case correctly.

Instead, as it iterates through the parts, it just overwrites the preceding part with each file in the uploaded collection.

I think a better strategy is to always have the value of the component be a List<Part> instead of just Part.

There are no comments yet on this issue.