[
https://issues.apache.org/jira/browse/MYFACES-4004?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14935629#comment-14935629
]
Leonardo Uribe commented on MYFACES-4004:
-----------------------------------------
I tried to reproduce the problem without success. I tried something like this:
<form jsf:id="form" enctype="multipart/form-data">
<h:messages/>
<h:panelGrid columns="2">
<h:outputText value="File:"/>
<input jsf:id="file" type="file"
jsf:value="#{uploadPage.uploadedFile}"
jsf:validator="#{uploadPage.validateFile}"/>
</h:panelGrid>
<button jsf:action="#{uploadPage.uploadFile}">Upload File</button>
<button jsf:action="#{uploadPage.uploadFile}">
Upload File (Ajax)
<f:ajax execute="file" render="@all"/>
</button>
<h:panelGrid id="content" columns="1">
<h:outputText value="Content:"/>
<textarea readonly="true" jsf:value="#{uploadPage.fileContent}"
rows="10" cols="100"/>
</h:panelGrid>
</form>
And it works without problem. I checked the renderer and enctype is not
ignored, it is a property, but I notice that it is important for the <form> tag
to have a jsf attribute (in this case jsf:id), as described on the spec javadoc
of javax.faces.view.facelets.TagDecorator:
".. If one or more of the attributes of the tag argument are in the
http://xmlns.jcp.org/jsf namespace, obtain a reference to decoratedTag ..."
It means the conversion from html5 tag to jsf component is active only when a
jsf:xxx attribute is found.
I'll close this issue as cannot reproduce, because we cannot identify any issue
here (at least we don't have a valid example that shows the opposite).
> Non-jsf-attribute enctype of passthrough form generates faces message
> ---------------------------------------------------------------------
>
> Key: MYFACES-4004
> URL: https://issues.apache.org/jira/browse/MYFACES-4004
> Project: MyFaces Core
> Issue Type: Bug
> Affects Versions: 2.2.8
> Environment: TomEE 1.7.1, Linux
> Reporter: Christian Kalkhoff
> Assignee: Leonardo Uribe
> Priority: Minor
>
> I created a html5 form with jsf:action which makes it a <h:form>. I added the
> attribute enctype to support file uploads which works fine then.
> On submitting the form (using AJAX) I get the message:
> {code}
> These unhandled FacesMessages are:
> - file upload requires a form with enctype equal to multipart/form-data
> {code}
> If i add jsf: to enctype (jsf:enctype) the message disappears.
> The message does not show up in my h:messages lists.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)