jQuery in Action, 2nd edition*
The moose likes JSF and the fly likes Issue with storing file name and content type using IBM's hx:fileupload in a datatable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Issue with storing file name and content type using IBM Watch "Issue with storing file name and content type using IBM New topic
Author

Issue with storing file name and content type using IBM's hx:fileupload in a datatable

Ajay Dhar
Ranch Hand

Joined: Jan 26, 2011
Posts: 30
When I use the hx:fileupload outside of a datatable I am able to store the file name and content type into my backing bean. However, when I put hx:fileupload components in a datatable the file name and content type are not stored, and they show up as null when I print them to the console.

Here is my JSF page:



Here is my backing bean (pagecode):



The reason I am keeping the fileupload components in a datatable is because there is a requirement to externalize in a properties file the number of fileupload components that are displayed. I have also externalized the accepted content types and combined max file size in properties files.

Currently I have 3 fileuploads displayed within the datatable and one outside the datatable for testing. When I try to upload the same text file in one of the uploads in the datatable and the one upload outside of the datatable I get the following print out in the console:

null null is 5 bytes and the content type is null.
C:\Users\dp0ad3\Desktop\TestUpload.txt text/plain

As you can see, the file name and content type for the upload component in the datatable are not stored, whereas this information for the upload component outside the datatable is.

Anyone know why I am seeing this behavior and/or how to work around it?

Thanks.

OCPJP 6, OCEEJBD 6, GIAC Secure Software Programmer-Java (GSSP-Java)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Issue with storing file name and content type using IBM's hx:fileupload in a datatable
 
Similar Threads
Accessing a Variable declared in a Servlet from a bean
JSF fileupload
Dynamic UI generation problem while opening popup
Carry values between page submit
Conversion Error setting value