t:inputFileUpload UploadedFile returns null
Today I was faced with a problem using the t:inputFileUpload control from MyFaces/Tomahawk.
I implemented a Backing Bean with a UploadedFile Property and include the component into my existing jsf page like this:
<t:inputFileUpload id="myUploadedFile" storage="file" immediate="false"
value="#{workitemLobBean.uploadedFile}">
</t:inputFileUpload>
The problem was that in my backing bean the uploadedFile property never was set. So it was null and I was unable to get the selected file out of my form :-(
After a long time searching I found the following solution:
Do not forget to add the "enctype" attribute to your Form and set this attribute to "multipart/form-data". So your h:form tag should finally look something like this:
<h:form enctype="multipart/form-data">
Posted at 08:09PM Jul 01, 2008
Posted by: Ralph
Category: General
Posted by Cale on July 23, 2008 at 03:29 PM GMT #
Posted by patrice on April 13, 2010 at 08:17 AM GMT #
Posted by Carlos David on June 21, 2011 at 10:44 PM GMT #
Posted by Sole on June 30, 2011 at 10:39 PM GMT #
Posted by sukram7 on September 02, 2011 at 07:46 AM GMT #