You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Dave Brondsema <da...@brondsema.net> on 2006/06/16 21:39:12 UTC

Keeping inputFileUpload's file even if other validation errors?

Is there a way to store the inputFileUpload file even if there are
process validation errors on other components?  I don't want the user to
have to re-upload a file if they forgot some other required field, for
example.

Thanks,

-- 
Dave Brondsema
Software Developer
Cornerstone University


Re: Keeping inputFileUpload's file even if other validation errors?

Posted by Dave Brondsema <da...@brondsema.net>.
Yes that works!  Thanks!

event.getNewValue() is the UploadedFile that I need.  I will document
this on the Setup_For_File_Uploads wiki page with some more example
code, when I have all my stuff working well.

Cosma Colanicchia wrote:
> I don't know if (and when) ValueChangeListener is triggered with
> immediate UIInput components, but you can try this: set a binding on
> your upload component and set a valuechangelistener for it. If this
> fires before other validations, you should have a chance to retrieve
> the uploaded data from the component itself and save it somewhere..
> 
> Cosma
> 
> 
> 
> 2006/6/22, Dave Brondsema <da...@brondsema.net>:
>> Hmm, good idea but it doesn't work.  "if any non-immediate component
>> fails validation, then no backing bean updates will be performed"  So
>> the code in my backing bean still doesn't get executed.
>>
>> I'm thinking that it would have to be some sort of PhaseListener or
>> changes to the file upload component.  Anybody else have ideas?
>>
>> Matthias Wessendorf wrote:
>> > See [1]
>> >
>> > [1] http://wiki.apache.org/myfaces/How_The_Immediate_Attribute_Works
>> >
>> > On 6/21/06, Matthias Wessendorf <ma...@apache.org> wrote:
>> >> have you tried immediate=true for the file input?
>> >> this "speacial logic" in the setMyFile() in your backingbean ?
>> >>
>> >> just a quick guess.
>> >>
>> >>
>> >> On 6/21/06, Dave Brondsema <da...@brondsema.net> wrote:
>> >> > Dave Brondsema wrote:
>> >> > > Is there a way to store the inputFileUpload file even if there are
>> >> > > process validation errors on other components?  I don't want the
>> >> user to
>> >> > > have to re-upload a file if they forgot some other required field,
>> >> for
>> >> > > example.
>> >> > >
>> >> > > Thanks,
>> >> > >
>> >> >
>> >> > So I guess there's no way to do this?  It seems like this would be a
>> >> > very important feature.  I really don't think it's acceptable to
>> >> force a
>> >> > user to upload a file multiple times.
>> >> >
>> >> > --
>> >> > Dave Brondsema
>> >> > Software Developer
>> >> > Cornerstone University
>> >> >
>> >> >
>> >> >
>> >> >
>> >>
>> >>
>> >> --
>> >> Matthias Wessendorf
>> >> Aechterhoek 18
>> >> 48282 Emsdetten
>> >> blog: http://jroller.com/page/mwessendorf
>> >> mail: mwessendorf-at-gmail-dot-com
>> >>
>> >
>> >
>>
>>
>> -- 
>> Dave Brondsema
>> Software Developer
>> Cornerstone University
>>
>>
>>
>>
> 


-- 
Dave Brondsema
Software Developer
Cornerstone University


Re: Keeping inputFileUpload's file even if other validation errors?

Posted by Cosma Colanicchia <co...@gmail.com>.
I don't know if (and when) ValueChangeListener is triggered with
immediate UIInput components, but you can try this: set a binding on
your upload component and set a valuechangelistener for it. If this
fires before other validations, you should have a chance to retrieve
the uploaded data from the component itself and save it somewhere..

Cosma



2006/6/22, Dave Brondsema <da...@brondsema.net>:
> Hmm, good idea but it doesn't work.  "if any non-immediate component
> fails validation, then no backing bean updates will be performed"  So
> the code in my backing bean still doesn't get executed.
>
> I'm thinking that it would have to be some sort of PhaseListener or
> changes to the file upload component.  Anybody else have ideas?
>
> Matthias Wessendorf wrote:
> > See [1]
> >
> > [1] http://wiki.apache.org/myfaces/How_The_Immediate_Attribute_Works
> >
> > On 6/21/06, Matthias Wessendorf <ma...@apache.org> wrote:
> >> have you tried immediate=true for the file input?
> >> this "speacial logic" in the setMyFile() in your backingbean ?
> >>
> >> just a quick guess.
> >>
> >>
> >> On 6/21/06, Dave Brondsema <da...@brondsema.net> wrote:
> >> > Dave Brondsema wrote:
> >> > > Is there a way to store the inputFileUpload file even if there are
> >> > > process validation errors on other components?  I don't want the
> >> user to
> >> > > have to re-upload a file if they forgot some other required field,
> >> for
> >> > > example.
> >> > >
> >> > > Thanks,
> >> > >
> >> >
> >> > So I guess there's no way to do this?  It seems like this would be a
> >> > very important feature.  I really don't think it's acceptable to
> >> force a
> >> > user to upload a file multiple times.
> >> >
> >> > --
> >> > Dave Brondsema
> >> > Software Developer
> >> > Cornerstone University
> >> >
> >> >
> >> >
> >> >
> >>
> >>
> >> --
> >> Matthias Wessendorf
> >> Aechterhoek 18
> >> 48282 Emsdetten
> >> blog: http://jroller.com/page/mwessendorf
> >> mail: mwessendorf-at-gmail-dot-com
> >>
> >
> >
>
>
> --
> Dave Brondsema
> Software Developer
> Cornerstone University
>
>
>
>

Re: Keeping inputFileUpload's file even if other validation errors?

Posted by Dave Brondsema <da...@brondsema.net>.
Hmm, good idea but it doesn't work.  "if any non-immediate component
fails validation, then no backing bean updates will be performed"  So
the code in my backing bean still doesn't get executed.

I'm thinking that it would have to be some sort of PhaseListener or
changes to the file upload component.  Anybody else have ideas?

Matthias Wessendorf wrote:
> See [1]
> 
> [1] http://wiki.apache.org/myfaces/How_The_Immediate_Attribute_Works
> 
> On 6/21/06, Matthias Wessendorf <ma...@apache.org> wrote:
>> have you tried immediate=true for the file input?
>> this "speacial logic" in the setMyFile() in your backingbean ?
>>
>> just a quick guess.
>>
>>
>> On 6/21/06, Dave Brondsema <da...@brondsema.net> wrote:
>> > Dave Brondsema wrote:
>> > > Is there a way to store the inputFileUpload file even if there are
>> > > process validation errors on other components?  I don't want the
>> user to
>> > > have to re-upload a file if they forgot some other required field,
>> for
>> > > example.
>> > >
>> > > Thanks,
>> > >
>> >
>> > So I guess there's no way to do this?  It seems like this would be a
>> > very important feature.  I really don't think it's acceptable to
>> force a
>> > user to upload a file multiple times.
>> >
>> > --
>> > Dave Brondsema
>> > Software Developer
>> > Cornerstone University
>> >
>> >
>> >
>> >
>>
>>
>> -- 
>> Matthias Wessendorf
>> Aechterhoek 18
>> 48282 Emsdetten
>> blog: http://jroller.com/page/mwessendorf
>> mail: mwessendorf-at-gmail-dot-com
>>
> 
> 


-- 
Dave Brondsema
Software Developer
Cornerstone University


Re: Keeping inputFileUpload's file even if other validation errors?

Posted by Matthias Wessendorf <ma...@apache.org>.
See [1]

[1] http://wiki.apache.org/myfaces/How_The_Immediate_Attribute_Works

On 6/21/06, Matthias Wessendorf <ma...@apache.org> wrote:
> have you tried immediate=true for the file input?
> this "speacial logic" in the setMyFile() in your backingbean ?
>
> just a quick guess.
>
>
> On 6/21/06, Dave Brondsema <da...@brondsema.net> wrote:
> > Dave Brondsema wrote:
> > > Is there a way to store the inputFileUpload file even if there are
> > > process validation errors on other components?  I don't want the user to
> > > have to re-upload a file if they forgot some other required field, for
> > > example.
> > >
> > > Thanks,
> > >
> >
> > So I guess there's no way to do this?  It seems like this would be a
> > very important feature.  I really don't think it's acceptable to force a
> > user to upload a file multiple times.
> >
> > --
> > Dave Brondsema
> > Software Developer
> > Cornerstone University
> >
> >
> >
> >
>
>
> --
> Matthias Wessendorf
> Aechterhoek 18
> 48282 Emsdetten
> blog: http://jroller.com/page/mwessendorf
> mail: mwessendorf-at-gmail-dot-com
>


-- 
Matthias Wessendorf
Aechterhoek 18
48282 Emsdetten
blog: http://jroller.com/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com

Re: Keeping inputFileUpload's file even if other validation errors?

Posted by Matthias Wessendorf <ma...@apache.org>.
have you tried immediate=true for the file input?
this "speacial logic" in the setMyFile() in your backingbean ?

just a quick guess.


On 6/21/06, Dave Brondsema <da...@brondsema.net> wrote:
> Dave Brondsema wrote:
> > Is there a way to store the inputFileUpload file even if there are
> > process validation errors on other components?  I don't want the user to
> > have to re-upload a file if they forgot some other required field, for
> > example.
> >
> > Thanks,
> >
>
> So I guess there's no way to do this?  It seems like this would be a
> very important feature.  I really don't think it's acceptable to force a
> user to upload a file multiple times.
>
> --
> Dave Brondsema
> Software Developer
> Cornerstone University
>
>
>
>


-- 
Matthias Wessendorf
Aechterhoek 18
48282 Emsdetten
blog: http://jroller.com/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com

Re: Keeping inputFileUpload's file even if other validation errors?

Posted by Dave Brondsema <da...@brondsema.net>.
Dave Brondsema wrote:
> Is there a way to store the inputFileUpload file even if there are
> process validation errors on other components?  I don't want the user to
> have to re-upload a file if they forgot some other required field, for
> example.
> 
> Thanks,
> 

So I guess there's no way to do this?  It seems like this would be a
very important feature.  I really don't think it's acceptable to force a
user to upload a file multiple times.

-- 
Dave Brondsema
Software Developer
Cornerstone University