Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

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

Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?

Think of how stupid the average person is. And how half of them are stupider than that. But who reads this tiny ad?
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic