You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by ken carlino <ke...@gmail.com> on 2006/11/01 05:44:46 UTC
How to use the inputfileupload component
All,
I am trying to use the <inputfileupload > in myfaces.
Here is my html file:
<h:outputLabel styleClass="desc" for="file"
value="#{text['buildForm.file']}"/>
<t:message for="file" styleClass="fieldError"/>
<t:inputFileUpload id="file" value="#{addBuildForm.file}"
storage="file" required="true" styleClass="file medium">
<v:commonsValidator type="required" arg="#{text['buildForm.file']}"/>
</t:inputFileUpload>
And in my backbean, I have this :
private UploadedFile file;
public UploadedFile geFile() {
return file;
}
public void setFile(UploadedFile file) {
this.file = file;
}
But when I click the submit, the file property is null. I expect it is
popular by myfaces.
Can you please tell me what am i missing?
Thank you.
Re: How to use the inputfileupload component
Posted by Matthias Wessendorf <ma...@apache.org>.
do you have the extensionsfilter in web,xml?
do you use "multipart/form-data" as enctype attr setting on the form?
can you check against the demo?
here is an article on that
http://www.onjava.com/pub/a/onjava/2005/07/13/jsfupload.html
On 10/31/06, ken carlino <ke...@gmail.com> wrote:
> All,
>
>
> I am trying to use the <inputfileupload > in myfaces.
>
> Here is my html file:
>
> <h:outputLabel styleClass="desc" for="file"
> value="#{text['buildForm.file']}"/>
>
> <t:message for="file" styleClass="fieldError"/>
> <t:inputFileUpload id="file" value="#{addBuildForm.file}"
> storage="file" required="true" styleClass="file medium">
> <v:commonsValidator type="required" arg="#{text['buildForm.file']}"/>
> </t:inputFileUpload>
>
> And in my backbean, I have this :
> private UploadedFile file;
>
> public UploadedFile geFile() {
> return file;
> }
>
> public void setFile(UploadedFile file) {
> this.file = file;
> }
>
> But when I click the submit, the file property is null. I expect it is
> popular by myfaces.
>
> Can you please tell me what am i missing?
>
> Thank you.
>
--
Matthias Wessendorf
http://tinyurl.com/fmywh
further stuff:
blog: http://jroller.com/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com