Details
Description
The following markup was inspired by the ICEfaces inputFile tutorial, found here: http://facestutorials.icefaces.org/tutorial/inputFile-tutorial.html
Which shows that you can bind the "file" attribute of the <ice:inputFile/> component to a bean property:
<ice:inputFile
id="inputFile1" action="#{MyBean.action}" actionListener="#{MyBean.actionListener}"
binding="#{MyBean.inputFile}" buttonClass="my-inputfile" file="#{MyBean.file}"
label="#{MyMsgs.uploadResume}"
progressListener="#{MyBean.progressListener}" styleClass="my-inputfile"/>
However, the value binding on the "file" and "fileInfo" attributes are not setup right, because the bean's setFile() method is not called. Although I don't show "fileInfo" attribute in this example, I strongly suspect that a setFileInfo() bean method would not get called either.
Neil
Which shows that you can bind the "file" attribute of the <ice:inputFile/> component to a bean property:
<ice:inputFile
id="inputFile1" action="#{MyBean.action}" actionListener="#{MyBean.actionListener}"
binding="#{MyBean.inputFile}" buttonClass="my-inputfile" file="#{MyBean.file}"
label="#{MyMsgs.uploadResume}"
progressListener="#{MyBean.progressListener}" styleClass="my-inputfile"/>
However, the value binding on the "file" and "fileInfo" attributes are not setup right, because the bean's setFile() method is not called. Although I don't show "fileInfo" attribute in this example, I strongly suspect that a setFileInfo() bean method would not get called either.
Neil
Activity
Field | Original Value | New Value |
---|---|---|
Fix Version/s | 1.6DR#5 [ 10071 ] | |
Assignee Priority | P1 | |
Assignee | Mark Collette [ mark.collette ] |
Attachment | InputFile.java [ 10408 ] |
Summary | <ice:inputFile/> does not set the "file" or "fileInfo" attributes via methodbinding | <ice:inputFile/> does not set the "file" or "fileInfo" attributes via ValueBinding |
Repository | Revision | Date | User | Message |
ICEsoft Public SVN Repository | #13947 | Tue May 22 16:41:39 MDT 2007 | mark.collette | |
Files Changed | ||||
![]() |
Status | Open [ 1 ] | Resolved [ 5 ] |
Resolution | Fixed [ 1 ] |
Repository | Revision | Date | User | Message |
ICEsoft Public SVN Repository | #13965 | Thu May 24 09:46:40 MDT 2007 | mark.collette | |
Files Changed | ||||
![]() |
Fix Version/s | 1.6 [ 10031 ] |
Status | Resolved [ 5 ] | Closed [ 6 ] |
Assignee Priority | P1 | |
Assignee | Mark Collette [ mark.collette ] |
Repository | Revision | Date | User | Message |
ICEsoft Public SVN Repository | #15240 | Fri Nov 23 10:53:15 MST 2007 | mark.collette | |
Files Changed | ||||
![]() ![]() |
The file property of the ice:inputFile component is not related to the binding attribute. The file property is for a java.io.File object that represents the most recently uploaded file. Likewise, the fileInfo property contains more information on the status of a currently uploaded/uploading file. They are not meant to be bound to a bean property. Rather, if you use the binding attribute, then the bean with have a reference to the com.icesoft.faces.component.inputFile.InputFile object, and can then call getFile() and getFileInfo() on the InputFile, to query the status of the most recent upload, most likely while in an actionListener, action, or progressListener callback.