Issue Details (XML | Word | Printable)

Key: JAVASERVERFACES_SPEC_PUBLIC-1197
Type: New Feature New Feature
Status: Open Open
Priority: Minor Minor
Assignee: Unassigned
Reporter: Ed Burns
Votes: 1
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
javaserverfaces-spec-public

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:
Related
 

Tags:
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="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://xmlns.jcp.org/jsf/passthrough">
    <h:head></h:head>

    <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" />
           </h:inputFile>
        </p>
...

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.



No work has yet been logged on this issue.