This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes JSF and the fly likes Creating HtmlInputFileUpload in Java code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Creating HtmlInputFileUpload in Java code" Watch "Creating HtmlInputFileUpload in Java code" New topic
Author

Creating HtmlInputFileUpload in Java code

Steve Kirkby
Greenhorn

Joined: Nov 06, 2011
Posts: 1
I'm trying to create a JSF <t:inputFileUpload> component, but in a Java class, not in jsp page.
The code I'm trying is:



I can't get the inputFileUpload to bind to the attribute uploadedFile in the backing bean.
None of the 'setValue' or 'setValueBinding' methods I've tried have worked.

Any suggestions??

Thanks
Marcos Silvestri
Ranch Hand

Joined: Dec 06, 2009
Posts: 62

I don't know if you are aware of the RichFaces component <rich:fileUpload> and trying to reinvent the wheel, so I think it's worth sharing this just in case:

http://livedemo.exadel.com/richfaces-demo/richfaces/fileUpload.jsf

http://docs.jboss.org/richfaces/latest_3_3_X/en/devguide/html/rich_fileUpload.html

If you didn't know about it, and if you are allowed to use RichFaces, this component may fit like a glove. Now, if you do need to proceed as you're doing it, you'd better wait for some more feedback...

Good luck!


DJ aspirant, Engineering undergraduate, Tokusatsus addicted, fond of English language and Asia's, Buddhist, blogger, etc. I'll need to insert all these attributes in a Java class and manage to create methods for handling my overwhelming life
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Creating HtmlInputFileUpload in Java code
 
Similar Threads
JAXB Exception - unable to extract the schema information etc
Static Binding and Dynamic Binding
Castor xml : custom field type
Add dynamic component to panelgrid with existing component
Java + Groovy variable binding