You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Daniel Meier <me...@sunrise.ch> on 2012/02/06 14:33:31 UTC

MulitFileUploadField looses state after validation error

Hi everyone

Little advice needed: I have a Form with several TextField's and a
MultiFileUploadField. If you select some files to upload and enter some
text in the TextFields - after the submit everything is fine.
Now if in case some TextField fire a validation error and the page is
rendered again, you have to select the files to upload one more time. Is
there any possibility to keep the state as long as validation errors occur?
Btw same problem wit FileUploadField.

Using wicket 1.5.3.

thx

RE: MulitFileUploadField looses state after validation error

Posted by Wilhelmsen Tor Iver <To...@arrive.no>.
No, the only workaround is probably to do the FileUpload logic during validation, and "flag" the upload field as completed somehow (or just show that files have been uploaded)

- Tor Iver

-----Original Message-----
From: Daniel Meier [mailto:meier_daniel@sunrise.ch] 
Sent: 6. februar 2012 14:34
To: users@wicket.apache.org
Subject: MulitFileUploadField looses state after validation error

Hi everyone

Little advice needed: I have a Form with several TextField's and a MultiFileUploadField. If you select some files to upload and enter some text in the TextFields - after the submit everything is fine.
Now if in case some TextField fire a validation error and the page is rendered again, you have to select the files to upload one more time. Is there any possibility to keep the state as long as validation errors occur?
Btw same problem wit FileUploadField.

Using wicket 1.5.3.

thx

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: MulitFileUploadField looses state after validation error

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

You can add AjaxFormComponentUpdatingBehavior to all TextFields and
set some error class when they are invalid. Add onsubmit event
listener (pure JS) to the form that will check all form elements for
such class and refuse the submit (by returning false) if there is at
least one invalid text field.

On Mon, Feb 6, 2012 at 3:33 PM, Daniel Meier <me...@sunrise.ch> wrote:
> Hi everyone
>
> Little advice needed: I have a Form with several TextField's and a
> MultiFileUploadField. If you select some files to upload and enter some
> text in the TextFields - after the submit everything is fine.
> Now if in case some TextField fire a validation error and the page is
> rendered again, you have to select the files to upload one more time. Is
> there any possibility to keep the state as long as validation errors occur?
> Btw same problem wit FileUploadField.
>
> Using wicket 1.5.3.
>
> thx



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org