Form looses data

classic Classic list List threaded Threaded
26 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Form looses data

Mike Mander
Hi,

i've added a domain model globally to my session.

A form for editing this data is provided on page A. On this i have 2
submit buttons. One with setDefaultFormProcessing false (to previous
page) and one with true (to next step).

If i press the main submit (next step | dfp = true) then everything
works as expected. If i press the other (previous page |dfp = false) and
redirect to Page A all data are lost. I'm absolutely aware of the issue
that false in defaultFormProcessing is not submitting the data.

But because i cannot reproduce the input changed part of the form
processing, i can't submit the invalid data manually. Is there any way
to achieve my goal?

Thanks
Mike

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Form looses data

Bruno Borges
Shouldn't you be submitting that button anyway? dfp = true


*Bruno Borges*
www.brunoborges.com.br
+55 21 76727099



On Thu, Aug 11, 2011 at 10:44 AM, Mike Mander <[hidden email]> wrote:

> Hi,
>
> i've added a domain model globally to my session.
>
> A form for editing this data is provided on page A. On this i have 2 submit
> buttons. One with setDefaultFormProcessing false (to previous page) and one
> with true (to next step).
>
> If i press the main submit (next step | dfp = true) then everything works
> as expected. If i press the other (previous page |dfp = false) and redirect
> to Page A all data are lost. I'm absolutely aware of the issue that false in
> defaultFormProcessing is not submitting the data.
>
> But because i cannot reproduce the input changed part of the form
> processing, i can't submit the invalid data manually. Is there any way to
> achieve my goal?
>
> Thanks
> Mike
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.org<[hidden email]>
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Form looses data

Mike Mander
Am 11.08.2011 16:36, schrieb Bruno Borges:

> Shouldn't you be submitting that button anyway? dfp = true
>
>
> *Bruno Borges*
> www.brunoborges.com.br
> +55 21 76727099
>
>
>
> On Thu, Aug 11, 2011 at 10:44 AM, Mike Mander<[hidden email]>  wrote:
>
>> Hi,
>>
>> i've added a domain model globally to my session.
>>
>> A form for editing this data is provided on page A. On this i have 2 submit
>> buttons. One with setDefaultFormProcessing false (to previous page) and one
>> with true (to next step).
>>
>> If i press the main submit (next step | dfp = true) then everything works
>> as expected. If i press the other (previous page |dfp = false) and redirect
>> to Page A all data are lost. I'm absolutely aware of the issue that false in
>> defaultFormProcessing is not submitting the data.
>>
>> But because i cannot reproduce the input changed part of the form
>> processing, i can't submit the invalid data manually. Is there any way to
>> achieve my goal?
>>
>> Thanks
>> Mike
>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.org<[hidden email]>
>> For additional commands, e-mail: [hidden email]
>>
>>
Then i can't goback to previous page without filling the form.

The scenario is
1. goto basket
2. goto checkout (Page A in post) enter some data
3. goback to basket (dfp = false) validation should be bypassed
4. goto checkout => all entered data are present

But until now with this scenario i lost all data in step 4

Thanks
Mike

PS: I use buttons to stay in javascript-less mode :-)

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Form looses data

Bruno Borges
You want to go back to another page without having to fill the form, but you
also don't want to lose data you typed in in the previous screen? Seems
weird to me.

Have you considered to add Ajax update behaviour? onBlur of components, you
could update the model of each component.
*Bruno Borges*
www.brunoborges.com.br
+55 21 76727099



On Thu, Aug 11, 2011 at 11:50 AM, Mike Mander <[hidden email]> wrote:

> Am 11.08.2011 16:36, schrieb Bruno Borges:
>
>> Shouldn't you be submitting that button anyway? dfp = true
>>
>>
>> *Bruno Borges*
>> www.brunoborges.com.br
>> +55 21 76727099
>>
>>
>>
>> On Thu, Aug 11, 2011 at 10:44 AM, Mike Mander<[hidden email]>  wrote:
>>
>>  Hi,
>>>
>>> i've added a domain model globally to my session.
>>>
>>> A form for editing this data is provided on page A. On this i have 2
>>> submit
>>> buttons. One with setDefaultFormProcessing false (to previous page) and
>>> one
>>> with true (to next step).
>>>
>>> If i press the main submit (next step | dfp = true) then everything works
>>> as expected. If i press the other (previous page |dfp = false) and
>>> redirect
>>> to Page A all data are lost. I'm absolutely aware of the issue that false
>>> in
>>> defaultFormProcessing is not submitting the data.
>>>
>>> But because i cannot reproduce the input changed part of the form
>>> processing, i can't submit the invalid data manually. Is there any way to
>>> achieve my goal?
>>>
>>> Thanks
>>> Mike
>>>
>>> ------------------------------****----------------------------**
>>> --**---------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.**apa**che.org<http://apache.org>
>>> <users-unsubscribe@**wicket.apache.org<[hidden email]>
>>> >
>>>
>>> For additional commands, e-mail: [hidden email]
>>>
>>>
>>>  Then i can't goback to previous page without filling the form.
>
> The scenario is
> 1. goto basket
> 2. goto checkout (Page A in post) enter some data
> 3. goback to basket (dfp = false) validation should be bypassed
> 4. goto checkout => all entered data are present
>
> But until now with this scenario i lost all data in step 4
>
> Thanks
> Mike
>
> PS: I use buttons to stay in javascript-less mode :-)
>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.org<[hidden email]>
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Form looses data

Mike Mander
Am 11.08.2011 16:54, schrieb Bruno Borges:

> You want to go back to another page without having to fill the form, but you
> also don't want to lose data you typed in in the previous screen? Seems
> weird to me.
>
> Have you considered to add Ajax update behaviour? onBlur of components, you
> could update the model of each component.
> *Bruno Borges*
> www.brunoborges.com.br
> +55 21 76727099
>
>
>
> On Thu, Aug 11, 2011 at 11:50 AM, Mike Mander<[hidden email]>  wrote:
>
>> Am 11.08.2011 16:36, schrieb Bruno Borges:
>>
>>> Shouldn't you be submitting that button anyway? dfp = true
>>>
>>>
>>> *Bruno Borges*
>>> www.brunoborges.com.br
>>> +55 21 76727099
>>>
>>>
>>>
>>> On Thu, Aug 11, 2011 at 10:44 AM, Mike Mander<[hidden email]>   wrote:
>>>
>>>   Hi,
>>>> i've added a domain model globally to my session.
>>>>
>>>> A form for editing this data is provided on page A. On this i have 2
>>>> submit
>>>> buttons. One with setDefaultFormProcessing false (to previous page) and
>>>> one
>>>> with true (to next step).
>>>>
>>>> If i press the main submit (next step | dfp = true) then everything works
>>>> as expected. If i press the other (previous page |dfp = false) and
>>>> redirect
>>>> to Page A all data are lost. I'm absolutely aware of the issue that false
>>>> in
>>>> defaultFormProcessing is not submitting the data.
>>>>
>>>> But because i cannot reproduce the input changed part of the form
>>>> processing, i can't submit the invalid data manually. Is there any way to
>>>> achieve my goal?
>>>>
>>>> Thanks
>>>> Mike
>>>>
>>>> ------------------------------****----------------------------**
>>>> --**---------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.**apa**che.org<http://apache.org>
>>>> <users-unsubscribe@**wicket.apache.org<[hidden email]>
>>>> For additional commands, e-mail: [hidden email]
>>>>
>>>>
>>>>   Then i can't goback to previous page without filling the form.
>> The scenario is
>> 1. goto basket
>> 2. goto checkout (Page A in post) enter some data
>> 3. goback to basket (dfp = false) validation should be bypassed
>> 4. goto checkout =>  all entered data are present
>>
>> But until now with this scenario i lost all data in step 4
>>
>> Thanks
>> Mike
>>
>> PS: I use buttons to stay in javascript-less mode :-)
>>
>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.org<[hidden email]>
>> For additional commands, e-mail: [hidden email]
>>
>>
Ajax is not an option - i have to stay javascript-less.

>  You want to go back to another page without having to fill the form, but you
>  also don't want to lose data you typed in in the previous screen? Seems
>  weird to me.
Not the previous screen. The current screen.

I come from basket. I goto checkout. I start typing. I think oops what was the option in basket
and goback to basket (dfp = false). I check the basket option and think ok let's go on checkout.
And on checkout i think - damn all typed data have gone. So i leave the shop.

That's the scenario i try to catch.

Thanks
Mike



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Form looses data

Bruno Borges
In your GoBack button's submit method (dpf = false), call

   form.updateFormComponentModels()



*Bruno Borges *
www.brunoborges.com.br
+55 21 76727099



On Thu, Aug 11, 2011 at 12:08 PM, Mike Mander <[hidden email]> wrote:

> Am 11.08.2011 16:54, schrieb Bruno Borges:
>
>> You want to go back to another page without having to fill the form, but
>> you
>> also don't want to lose data you typed in in the previous screen? Seems
>> weird to me.
>>
>> Have you considered to add Ajax update behaviour? onBlur of components,
>> you
>> could update the model of each component.
>> *Bruno Borges*
>> www.brunoborges.com.br
>> +55 21 76727099
>>
>>
>>
>> On Thu, Aug 11, 2011 at 11:50 AM, Mike Mander<[hidden email]>  wrote:
>>
>>  Am 11.08.2011 16:36, schrieb Bruno Borges:
>>>
>>>  Shouldn't you be submitting that button anyway? dfp = true
>>>>
>>>>
>>>> *Bruno Borges*
>>>> www.brunoborges.com.br
>>>> +55 21 76727099
>>>>
>>>>
>>>>
>>>> On Thu, Aug 11, 2011 at 10:44 AM, Mike Mander<[hidden email]>
>>>> wrote:
>>>>
>>>>  Hi,
>>>>
>>>>> i've added a domain model globally to my session.
>>>>>
>>>>> A form for editing this data is provided on page A. On this i have 2
>>>>> submit
>>>>> buttons. One with setDefaultFormProcessing false (to previous page) and
>>>>> one
>>>>> with true (to next step).
>>>>>
>>>>> If i press the main submit (next step | dfp = true) then everything
>>>>> works
>>>>> as expected. If i press the other (previous page |dfp = false) and
>>>>> redirect
>>>>> to Page A all data are lost. I'm absolutely aware of the issue that
>>>>> false
>>>>> in
>>>>> defaultFormProcessing is not submitting the data.
>>>>>
>>>>> But because i cannot reproduce the input changed part of the form
>>>>> processing, i can't submit the invalid data manually. Is there any way
>>>>> to
>>>>> achieve my goal?
>>>>>
>>>>> Thanks
>>>>> Mike
>>>>>
>>>>> ------------------------------******--------------------------**--**
>>>>> --**---------
>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.****apa**che.org<
>>>>> http://apache.org**>
>>>>> <users-unsubscribe@**wicket.**apache.org <http://wicket.apache.org><
>>>>> users-unsubscribe@**wicket.apache.org<[hidden email]>
>>>>> >
>>>>>
>>>>> For additional commands, e-mail: [hidden email]
>>>>>
>>>>>
>>>>>  Then i can't goback to previous page without filling the form.
>>>>>
>>>> The scenario is
>>> 1. goto basket
>>> 2. goto checkout (Page A in post) enter some data
>>> 3. goback to basket (dfp = false) validation should be bypassed
>>> 4. goto checkout =>  all entered data are present
>>>
>>> But until now with this scenario i lost all data in step 4
>>>
>>> Thanks
>>> Mike
>>>
>>> PS: I use buttons to stay in javascript-less mode :-)
>>>
>>>
>>> ------------------------------****----------------------------**
>>> --**---------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.**apa**che.org<http://apache.org>
>>> <users-unsubscribe@**wicket.apache.org<[hidden email]>
>>> >
>>> For additional commands, e-mail: [hidden email]
>>>
>>>
>>>  Ajax is not an option - i have to stay javascript-less.
>
>
>   You want to go back to another page without having to fill the form, but
>> you
>>  also don't want to lose data you typed in in the previous screen? Seems
>>  weird to me.
>>
> Not the previous screen. The current screen.
>
> I come from basket. I goto checkout. I start typing. I think oops what was
> the option in basket
> and goback to basket (dfp = false). I check the basket option and think ok
> let's go on checkout.
> And on checkout i think - damn all typed data have gone. So i leave the
> shop.
>
> That's the scenario i try to catch.
>
>
> Thanks
> Mike
>
>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.org<[hidden email]>
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Form looses data

Martin Makundi
Is possible using reuseManager, but you need to keep reference to it somewhere.

http://apache-wicket.1842946.n4.nabble.com/Check-box-loses-checked-state-after-error-td1855690.html

**
Martin

2011/8/11 Bruno Borges <[hidden email]>:

> In your GoBack button's submit method (dpf = false), call
>
>   form.updateFormComponentModels()
>
>
>
> *Bruno Borges *
> www.brunoborges.com.br
> +55 21 76727099
>
>
>
> On Thu, Aug 11, 2011 at 12:08 PM, Mike Mander <[hidden email]> wrote:
>
>> Am 11.08.2011 16:54, schrieb Bruno Borges:
>>
>>> You want to go back to another page without having to fill the form, but
>>> you
>>> also don't want to lose data you typed in in the previous screen? Seems
>>> weird to me.
>>>
>>> Have you considered to add Ajax update behaviour? onBlur of components,
>>> you
>>> could update the model of each component.
>>> *Bruno Borges*
>>> www.brunoborges.com.br
>>> +55 21 76727099
>>>
>>>
>>>
>>> On Thu, Aug 11, 2011 at 11:50 AM, Mike Mander<[hidden email]>  wrote:
>>>
>>>  Am 11.08.2011 16:36, schrieb Bruno Borges:
>>>>
>>>>  Shouldn't you be submitting that button anyway? dfp = true
>>>>>
>>>>>
>>>>> *Bruno Borges*
>>>>> www.brunoborges.com.br
>>>>> +55 21 76727099
>>>>>
>>>>>
>>>>>
>>>>> On Thu, Aug 11, 2011 at 10:44 AM, Mike Mander<[hidden email]>
>>>>> wrote:
>>>>>
>>>>>  Hi,
>>>>>
>>>>>> i've added a domain model globally to my session.
>>>>>>
>>>>>> A form for editing this data is provided on page A. On this i have 2
>>>>>> submit
>>>>>> buttons. One with setDefaultFormProcessing false (to previous page) and
>>>>>> one
>>>>>> with true (to next step).
>>>>>>
>>>>>> If i press the main submit (next step | dfp = true) then everything
>>>>>> works
>>>>>> as expected. If i press the other (previous page |dfp = false) and
>>>>>> redirect
>>>>>> to Page A all data are lost. I'm absolutely aware of the issue that
>>>>>> false
>>>>>> in
>>>>>> defaultFormProcessing is not submitting the data.
>>>>>>
>>>>>> But because i cannot reproduce the input changed part of the form
>>>>>> processing, i can't submit the invalid data manually. Is there any way
>>>>>> to
>>>>>> achieve my goal?
>>>>>>
>>>>>> Thanks
>>>>>> Mike
>>>>>>
>>>>>> ------------------------------******--------------------------**--**
>>>>>> --**---------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.****apa**che.org<
>>>>>> http://apache.org**>
>>>>>> <users-unsubscribe@**wicket.**apache.org <http://wicket.apache.org><
>>>>>> users-unsubscribe@**wicket.apache.org<[hidden email]>
>>>>>> >
>>>>>>
>>>>>> For additional commands, e-mail: [hidden email]
>>>>>>
>>>>>>
>>>>>>  Then i can't goback to previous page without filling the form.
>>>>>>
>>>>> The scenario is
>>>> 1. goto basket
>>>> 2. goto checkout (Page A in post) enter some data
>>>> 3. goback to basket (dfp = false) validation should be bypassed
>>>> 4. goto checkout =>  all entered data are present
>>>>
>>>> But until now with this scenario i lost all data in step 4
>>>>
>>>> Thanks
>>>> Mike
>>>>
>>>> PS: I use buttons to stay in javascript-less mode :-)
>>>>
>>>>
>>>> ------------------------------****----------------------------**
>>>> --**---------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.**apa**che.org<http://apache.org>
>>>> <users-unsubscribe@**wicket.apache.org<[hidden email]>
>>>> >
>>>> For additional commands, e-mail: [hidden email]
>>>>
>>>>
>>>>  Ajax is not an option - i have to stay javascript-less.
>>
>>
>>   You want to go back to another page without having to fill the form, but
>>> you
>>>  also don't want to lose data you typed in in the previous screen? Seems
>>>  weird to me.
>>>
>> Not the previous screen. The current screen.
>>
>> I come from basket. I goto checkout. I start typing. I think oops what was
>> the option in basket
>> and goback to basket (dfp = false). I check the basket option and think ok
>> let's go on checkout.
>> And on checkout i think - damn all typed data have gone. So i leave the
>> shop.
>>
>> That's the scenario i try to catch.
>>
>>
>> Thanks
>> Mike
>>
>>
>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.org<[hidden email]>
>> For additional commands, e-mail: [hidden email]
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Form looses data

Bruno Borges
Models must be updated anyway, and that's solved with
form.updateFormComponentModels()


*Bruno Borges*
www.brunoborges.com.br
+55 21 76727099



On Thu, Aug 11, 2011 at 12:21 PM, Martin Makundi <
[hidden email]> wrote:

> Is possible using reuseManager, but you need to keep reference to it
> somewhere.
>
>
> http://apache-wicket.1842946.n4.nabble.com/Check-box-loses-checked-state-after-error-td1855690.html
>
> **
> Martin
>
> 2011/8/11 Bruno Borges <[hidden email]>:
> > In your GoBack button's submit method (dpf = false), call
> >
> >   form.updateFormComponentModels()
> >
> >
> >
> > *Bruno Borges *
> > www.brunoborges.com.br
> > +55 21 76727099
> >
> >
> >
> > On Thu, Aug 11, 2011 at 12:08 PM, Mike Mander <[hidden email]>
> wrote:
> >
> >> Am 11.08.2011 16:54, schrieb Bruno Borges:
> >>
> >>> You want to go back to another page without having to fill the form,
> but
> >>> you
> >>> also don't want to lose data you typed in in the previous screen? Seems
> >>> weird to me.
> >>>
> >>> Have you considered to add Ajax update behaviour? onBlur of components,
> >>> you
> >>> could update the model of each component.
> >>> *Bruno Borges*
> >>> www.brunoborges.com.br
> >>> +55 21 76727099
> >>>
> >>>
> >>>
> >>> On Thu, Aug 11, 2011 at 11:50 AM, Mike Mander<[hidden email]>
>  wrote:
> >>>
> >>>  Am 11.08.2011 16:36, schrieb Bruno Borges:
> >>>>
> >>>>  Shouldn't you be submitting that button anyway? dfp = true
> >>>>>
> >>>>>
> >>>>> *Bruno Borges*
> >>>>> www.brunoborges.com.br
> >>>>> +55 21 76727099
> >>>>>
> >>>>>
> >>>>>
> >>>>> On Thu, Aug 11, 2011 at 10:44 AM, Mike Mander<[hidden email]>
> >>>>> wrote:
> >>>>>
> >>>>>  Hi,
> >>>>>
> >>>>>> i've added a domain model globally to my session.
> >>>>>>
> >>>>>> A form for editing this data is provided on page A. On this i have 2
> >>>>>> submit
> >>>>>> buttons. One with setDefaultFormProcessing false (to previous page)
> and
> >>>>>> one
> >>>>>> with true (to next step).
> >>>>>>
> >>>>>> If i press the main submit (next step | dfp = true) then everything
> >>>>>> works
> >>>>>> as expected. If i press the other (previous page |dfp = false) and
> >>>>>> redirect
> >>>>>> to Page A all data are lost. I'm absolutely aware of the issue that
> >>>>>> false
> >>>>>> in
> >>>>>> defaultFormProcessing is not submitting the data.
> >>>>>>
> >>>>>> But because i cannot reproduce the input changed part of the form
> >>>>>> processing, i can't submit the invalid data manually. Is there any
> way
> >>>>>> to
> >>>>>> achieve my goal?
> >>>>>>
> >>>>>> Thanks
> >>>>>> Mike
> >>>>>>
> >>>>>> ------------------------------******--------------------------**--**
> >>>>>> --**---------
> >>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.****apa**che.org<
> >>>>>> http://apache.org**>
> >>>>>> <users-unsubscribe@**wicket.**apache.org <http://wicket.apache.org
> ><
> >>>>>> users-unsubscribe@**wicket.apache.org<
> [hidden email]>
> >>>>>> >
> >>>>>>
> >>>>>> For additional commands, e-mail: [hidden email]
> >>>>>>
> >>>>>>
> >>>>>>  Then i can't goback to previous page without filling the form.
> >>>>>>
> >>>>> The scenario is
> >>>> 1. goto basket
> >>>> 2. goto checkout (Page A in post) enter some data
> >>>> 3. goback to basket (dfp = false) validation should be bypassed
> >>>> 4. goto checkout =>  all entered data are present
> >>>>
> >>>> But until now with this scenario i lost all data in step 4
> >>>>
> >>>> Thanks
> >>>> Mike
> >>>>
> >>>> PS: I use buttons to stay in javascript-less mode :-)
> >>>>
> >>>>
> >>>> ------------------------------****----------------------------**
> >>>> --**---------
> >>>> To unsubscribe, e-mail: users-unsubscribe@wicket.**apa**che.org<
> http://apache.org>
> >>>> <users-unsubscribe@**wicket.apache.org<
> [hidden email]>
> >>>> >
> >>>> For additional commands, e-mail: [hidden email]
> >>>>
> >>>>
> >>>>  Ajax is not an option - i have to stay javascript-less.
> >>
> >>
> >>   You want to go back to another page without having to fill the form,
> but
> >>> you
> >>>  also don't want to lose data you typed in in the previous screen?
> Seems
> >>>  weird to me.
> >>>
> >> Not the previous screen. The current screen.
> >>
> >> I come from basket. I goto checkout. I start typing. I think oops what
> was
> >> the option in basket
> >> and goback to basket (dfp = false). I check the basket option and think
> ok
> >> let's go on checkout.
> >> And on checkout i think - damn all typed data have gone. So i leave the
> >> shop.
> >>
> >> That's the scenario i try to catch.
> >>
> >>
> >> Thanks
> >> Mike
> >>
> >>
> >>
> >>
> ------------------------------**------------------------------**---------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.org<
> [hidden email]>
> >> For additional commands, e-mail: [hidden email]
> >>
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Form looses data

Martin Makundi
No, if you don't want to update models, you can use reusemanager. It
retains the raw unsubmitted values in rawInput fields.

**
Martin

2011/8/11 Bruno Borges <[hidden email]>:

> Models must be updated anyway, and that's solved with
> form.updateFormComponentModels()
>
>
> *Bruno Borges*
> www.brunoborges.com.br
> +55 21 76727099
>
>
>
> On Thu, Aug 11, 2011 at 12:21 PM, Martin Makundi <
> [hidden email]> wrote:
>
>> Is possible using reuseManager, but you need to keep reference to it
>> somewhere.
>>
>>
>> http://apache-wicket.1842946.n4.nabble.com/Check-box-loses-checked-state-after-error-td1855690.html
>>
>> **
>> Martin
>>
>> 2011/8/11 Bruno Borges <[hidden email]>:
>> > In your GoBack button's submit method (dpf = false), call
>> >
>> >   form.updateFormComponentModels()
>> >
>> >
>> >
>> > *Bruno Borges *
>> > www.brunoborges.com.br
>> > +55 21 76727099
>> >
>> >
>> >
>> > On Thu, Aug 11, 2011 at 12:08 PM, Mike Mander <[hidden email]>
>> wrote:
>> >
>> >> Am 11.08.2011 16:54, schrieb Bruno Borges:
>> >>
>> >>> You want to go back to another page without having to fill the form,
>> but
>> >>> you
>> >>> also don't want to lose data you typed in in the previous screen? Seems
>> >>> weird to me.
>> >>>
>> >>> Have you considered to add Ajax update behaviour? onBlur of components,
>> >>> you
>> >>> could update the model of each component.
>> >>> *Bruno Borges*
>> >>> www.brunoborges.com.br
>> >>> +55 21 76727099
>> >>>
>> >>>
>> >>>
>> >>> On Thu, Aug 11, 2011 at 11:50 AM, Mike Mander<[hidden email]>
>>  wrote:
>> >>>
>> >>>  Am 11.08.2011 16:36, schrieb Bruno Borges:
>> >>>>
>> >>>>  Shouldn't you be submitting that button anyway? dfp = true
>> >>>>>
>> >>>>>
>> >>>>> *Bruno Borges*
>> >>>>> www.brunoborges.com.br
>> >>>>> +55 21 76727099
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>> On Thu, Aug 11, 2011 at 10:44 AM, Mike Mander<[hidden email]>
>> >>>>> wrote:
>> >>>>>
>> >>>>>  Hi,
>> >>>>>
>> >>>>>> i've added a domain model globally to my session.
>> >>>>>>
>> >>>>>> A form for editing this data is provided on page A. On this i have 2
>> >>>>>> submit
>> >>>>>> buttons. One with setDefaultFormProcessing false (to previous page)
>> and
>> >>>>>> one
>> >>>>>> with true (to next step).
>> >>>>>>
>> >>>>>> If i press the main submit (next step | dfp = true) then everything
>> >>>>>> works
>> >>>>>> as expected. If i press the other (previous page |dfp = false) and
>> >>>>>> redirect
>> >>>>>> to Page A all data are lost. I'm absolutely aware of the issue that
>> >>>>>> false
>> >>>>>> in
>> >>>>>> defaultFormProcessing is not submitting the data.
>> >>>>>>
>> >>>>>> But because i cannot reproduce the input changed part of the form
>> >>>>>> processing, i can't submit the invalid data manually. Is there any
>> way
>> >>>>>> to
>> >>>>>> achieve my goal?
>> >>>>>>
>> >>>>>> Thanks
>> >>>>>> Mike
>> >>>>>>
>> >>>>>> ------------------------------******--------------------------**--**
>> >>>>>> --**---------
>> >>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.****apa**che.org<
>> >>>>>> http://apache.org**>
>> >>>>>> <users-unsubscribe@**wicket.**apache.org <http://wicket.apache.org
>> ><
>> >>>>>> users-unsubscribe@**wicket.apache.org<
>> [hidden email]>
>> >>>>>> >
>> >>>>>>
>> >>>>>> For additional commands, e-mail: [hidden email]
>> >>>>>>
>> >>>>>>
>> >>>>>>  Then i can't goback to previous page without filling the form.
>> >>>>>>
>> >>>>> The scenario is
>> >>>> 1. goto basket
>> >>>> 2. goto checkout (Page A in post) enter some data
>> >>>> 3. goback to basket (dfp = false) validation should be bypassed
>> >>>> 4. goto checkout =>  all entered data are present
>> >>>>
>> >>>> But until now with this scenario i lost all data in step 4
>> >>>>
>> >>>> Thanks
>> >>>> Mike
>> >>>>
>> >>>> PS: I use buttons to stay in javascript-less mode :-)
>> >>>>
>> >>>>
>> >>>> ------------------------------****----------------------------**
>> >>>> --**---------
>> >>>> To unsubscribe, e-mail: users-unsubscribe@wicket.**apa**che.org<
>> http://apache.org>
>> >>>> <users-unsubscribe@**wicket.apache.org<
>> [hidden email]>
>> >>>> >
>> >>>> For additional commands, e-mail: [hidden email]
>> >>>>
>> >>>>
>> >>>>  Ajax is not an option - i have to stay javascript-less.
>> >>
>> >>
>> >>   You want to go back to another page without having to fill the form,
>> but
>> >>> you
>> >>>  also don't want to lose data you typed in in the previous screen?
>> Seems
>> >>>  weird to me.
>> >>>
>> >> Not the previous screen. The current screen.
>> >>
>> >> I come from basket. I goto checkout. I start typing. I think oops what
>> was
>> >> the option in basket
>> >> and goback to basket (dfp = false). I check the basket option and think
>> ok
>> >> let's go on checkout.
>> >> And on checkout i think - damn all typed data have gone. So i leave the
>> >> shop.
>> >>
>> >> That's the scenario i try to catch.
>> >>
>> >>
>> >> Thanks
>> >> Mike
>> >>
>> >>
>> >>
>> >>
>> ------------------------------**------------------------------**---------
>> >> To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.org<
>> [hidden email]>
>> >> For additional commands, e-mail: [hidden email]
>> >>
>> >>
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Form looses data

Mike Mander
In reply to this post by Martin Makundi
Hello Martin Makundi,

i have some questions for usage of this.
1. Where do i have to put my instance of reusemanager?
2. What is MarkupUtils.fakeRawInput and MarkupUtils.replaceReporter doing?
3. I don't have any persistent id (rowid) for usage.
4. Do you have a working example for me?

Thanks
Mike

> Is possible using reuseManager, but you need to keep reference to it somewhere.
>
> http://apache-wicket.1842946.n4.nabble.com/Check-box-loses-checked-state-after-error-td1855690.html
>
> **
> Martin
>
> 2011/8/11 Bruno Borges<[hidden email]>:
>> In your GoBack button's submit method (dpf = false), call
>>
>>    form.updateFormComponentModels()
>>
>>
>>
>> *Bruno Borges *
>> www.brunoborges.com.br
>> +55 21 76727099
>>
>>
>>
>> On Thu, Aug 11, 2011 at 12:08 PM, Mike Mander<[hidden email]>  wrote:
>>
>>> Am 11.08.2011 16:54, schrieb Bruno Borges:
>>>
>>>> You want to go back to another page without having to fill the form, but
>>>> you
>>>> also don't want to lose data you typed in in the previous screen? Seems
>>>> weird to me.
>>>>
>>>> Have you considered to add Ajax update behaviour? onBlur of components,
>>>> you
>>>> could update the model of each component.
>>>> *Bruno Borges*
>>>> www.brunoborges.com.br
>>>> +55 21 76727099
>>>>
>>>>
>>>>
>>>> On Thu, Aug 11, 2011 at 11:50 AM, Mike Mander<[hidden email]>    wrote:
>>>>
>>>>   Am 11.08.2011 16:36, schrieb Bruno Borges:
>>>>>   Shouldn't you be submitting that button anyway? dfp = true
>>>>>>
>>>>>> *Bruno Borges*
>>>>>> www.brunoborges.com.br
>>>>>> +55 21 76727099
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Thu, Aug 11, 2011 at 10:44 AM, Mike Mander<[hidden email]>
>>>>>> wrote:
>>>>>>
>>>>>>   Hi,
>>>>>>
>>>>>>> i've added a domain model globally to my session.
>>>>>>>
>>>>>>> A form for editing this data is provided on page A. On this i have 2
>>>>>>> submit
>>>>>>> buttons. One with setDefaultFormProcessing false (to previous page) and
>>>>>>> one
>>>>>>> with true (to next step).
>>>>>>>
>>>>>>> If i press the main submit (next step | dfp = true) then everything
>>>>>>> works
>>>>>>> as expected. If i press the other (previous page |dfp = false) and
>>>>>>> redirect
>>>>>>> to Page A all data are lost. I'm absolutely aware of the issue that
>>>>>>> false
>>>>>>> in
>>>>>>> defaultFormProcessing is not submitting the data.
>>>>>>>
>>>>>>> But because i cannot reproduce the input changed part of the form
>>>>>>> processing, i can't submit the invalid data manually. Is there any way
>>>>>>> to
>>>>>>> achieve my goal?
>>>>>>>
>>>>>>> Thanks
>>>>>>> Mike
>>>>>>>
>>>>>>> ------------------------------******--------------------------**--**
>>>>>>> --**---------
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.****apa**che.org<
>>>>>>> http://apache.org**>
>>>>>>> <users-unsubscribe@**wicket.**apache.org<http://wicket.apache.org><
>>>>>>> users-unsubscribe@**wicket.apache.org<[hidden email]>
>>>>>>> For additional commands, e-mail: [hidden email]
>>>>>>>
>>>>>>>
>>>>>>>   Then i can't goback to previous page without filling the form.
>>>>>>>
>>>>>> The scenario is
>>>>> 1. goto basket
>>>>> 2. goto checkout (Page A in post) enter some data
>>>>> 3. goback to basket (dfp = false) validation should be bypassed
>>>>> 4. goto checkout =>    all entered data are present
>>>>>
>>>>> But until now with this scenario i lost all data in step 4
>>>>>
>>>>> Thanks
>>>>> Mike
>>>>>
>>>>> PS: I use buttons to stay in javascript-less mode :-)
>>>>>
>>>>>
>>>>> ------------------------------****----------------------------**
>>>>> --**---------
>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.**apa**che.org<http://apache.org>
>>>>> <users-unsubscribe@**wicket.apache.org<[hidden email]>
>>>>> For additional commands, e-mail: [hidden email]
>>>>>
>>>>>
>>>>>   Ajax is not an option - i have to stay javascript-less.
>>>
>>>    You want to go back to another page without having to fill the form, but
>>>> you
>>>>   also don't want to lose data you typed in in the previous screen? Seems
>>>>   weird to me.
>>>>
>>> Not the previous screen. The current screen.
>>>
>>> I come from basket. I goto checkout. I start typing. I think oops what was
>>> the option in basket
>>> and goback to basket (dfp = false). I check the basket option and think ok
>>> let's go on checkout.
>>> And on checkout i think - damn all typed data have gone. So i leave the
>>> shop.
>>>
>>> That's the scenario i try to catch.
>>>
>>>
>>> Thanks
>>> Mike
>>>
>>>
>>>
>>> ------------------------------**------------------------------**---------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.org<[hidden email]>
>>> For additional commands, e-mail: [hidden email]
>>>
>>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Form looses data

Martin Makundi
Hi!

> i have some questions for usage of this.
> 1. Where do i have to put my instance of reusemanager?

Where you want to keep the values? What is your "common denominator".
It can be a page or it can be in session... I normally use a Panel and
it keeps values of listview items' formcomponents during ajax rebuild
of listview.

> 2. What is MarkupUtils.fakeRawInput and MarkupUtils.replaceReporter doing?


      rawInputField = FormComponent.class.getDeclaredField("rawInput");
      rawInputField.setAccessible(true);
      reporterField = FeedbackMessage.class.getDeclaredField("reporter");
      reporterField.setAccessible(true);

/**
   * @param formComponent
   * @param <T>
   * @param existingComponent
   */
  public static <T extends FormComponent<?>> void fakeRawInput(T
formComponent, T existingComponent) {
    try {
      String rawInput = (String) rawInputField.get(existingComponent);
      fakeRawInput(formComponent, rawInput);
    } catch (Exception e) {
      Utils.errorLog(WicketUtils.class, "Fatal Error: Form field
access failed.", e);
    }
  }

/**
   * @param formComponent
   * @param <T>
   * @param value
   */
  public static <T extends FormComponent<?>> void fakeRawInput(T
formComponent, String value) {
    try {
      rawInputField.set(formComponent, value);
    } catch (Exception e) {
      Utils.errorLog(WicketUtils.class, "Fatal Error: Form field
access failed.", e);
    }
  }

/**
   * @param feedbackMessage
   * @param formComponent
   */
  public static void replaceReporter(FeedbackMessage feedbackMessage,
FormComponent<?> formComponent) {
    try {
      reporterField.set(feedbackMessage, formComponent);
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }

> 3. I don't have any persistent id (rowid) for usage.

Rowid can be something which is unique for each component. In listview
it is the item model object. If you don't have rows, it can be
something else, even a string index or component id or something.
Depends what you are making and how complex your page is.

> 4. Do you have a working example for me?

It's quite simple, really. Here are two examples one with string index
and another with model object id:

{
 //  A
         String taskIndex = dailyContainer.getIndex() + ":task." +
reuseManager.getUniqueIndex(task);

                  notesField = reuseManager.rememberOrReuse(taskIndex, NOTES_TD,
                      localNotesField);

                  notesContainer.add(notesField);

}

{
  // B
    protected void populateItem(final ListItem<Vacation> rowItem) {
      SqlDateTextField startDateField;
        startDateField = reuseManager.rememberOrReuse(vacation,
START_DATE, startDateField);
        rowItem.add(startDateField.setRequired(true));

}



Ah yes, and you might want to call reuseManager.clear if you want to
reset your context (similar to form.clearInput())

**
Martin


**
Martin

>
> Thanks
> Mike
>
>> Is possible using reuseManager, but you need to keep reference to it
>> somewhere.
>>
>>
>> http://apache-wicket.1842946.n4.nabble.com/Check-box-loses-checked-state-after-error-td1855690.html
>>
>> **
>> Martin
>>
>> 2011/8/11 Bruno Borges<[hidden email]>:
>>>
>>> In your GoBack button's submit method (dpf = false), call
>>>
>>>   form.updateFormComponentModels()
>>>
>>>
>>>
>>> *Bruno Borges *
>>> www.brunoborges.com.br
>>> +55 21 76727099
>>>
>>>
>>>
>>> On Thu, Aug 11, 2011 at 12:08 PM, Mike Mander<[hidden email]>  wrote:
>>>
>>>> Am 11.08.2011 16:54, schrieb Bruno Borges:
>>>>
>>>>> You want to go back to another page without having to fill the form,
>>>>> but
>>>>> you
>>>>> also don't want to lose data you typed in in the previous screen? Seems
>>>>> weird to me.
>>>>>
>>>>> Have you considered to add Ajax update behaviour? onBlur of components,
>>>>> you
>>>>> could update the model of each component.
>>>>> *Bruno Borges*
>>>>> www.brunoborges.com.br
>>>>> +55 21 76727099
>>>>>
>>>>>
>>>>>
>>>>> On Thu, Aug 11, 2011 at 11:50 AM, Mike Mander<[hidden email]>
>>>>>  wrote:
>>>>>
>>>>>  Am 11.08.2011 16:36, schrieb Bruno Borges:
>>>>>>
>>>>>>  Shouldn't you be submitting that button anyway? dfp = true
>>>>>>>
>>>>>>> *Bruno Borges*
>>>>>>> www.brunoborges.com.br
>>>>>>> +55 21 76727099
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Thu, Aug 11, 2011 at 10:44 AM, Mike Mander<[hidden email]>
>>>>>>> wrote:
>>>>>>>
>>>>>>>  Hi,
>>>>>>>
>>>>>>>> i've added a domain model globally to my session.
>>>>>>>>
>>>>>>>> A form for editing this data is provided on page A. On this i have 2
>>>>>>>> submit
>>>>>>>> buttons. One with setDefaultFormProcessing false (to previous page)
>>>>>>>> and
>>>>>>>> one
>>>>>>>> with true (to next step).
>>>>>>>>
>>>>>>>> If i press the main submit (next step | dfp = true) then everything
>>>>>>>> works
>>>>>>>> as expected. If i press the other (previous page |dfp = false) and
>>>>>>>> redirect
>>>>>>>> to Page A all data are lost. I'm absolutely aware of the issue that
>>>>>>>> false
>>>>>>>> in
>>>>>>>> defaultFormProcessing is not submitting the data.
>>>>>>>>
>>>>>>>> But because i cannot reproduce the input changed part of the form
>>>>>>>> processing, i can't submit the invalid data manually. Is there any
>>>>>>>> way
>>>>>>>> to
>>>>>>>> achieve my goal?
>>>>>>>>
>>>>>>>> Thanks
>>>>>>>> Mike
>>>>>>>>
>>>>>>>> ------------------------------******--------------------------**--**
>>>>>>>> --**---------
>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.****apa**che.org<
>>>>>>>> http://apache.org**>
>>>>>>>> <users-unsubscribe@**wicket.**apache.org<http://wicket.apache.org><
>>>>>>>>
>>>>>>>> users-unsubscribe@**wicket.apache.org<[hidden email]>
>>>>>>>> For additional commands, e-mail: [hidden email]
>>>>>>>>
>>>>>>>>
>>>>>>>>  Then i can't goback to previous page without filling the form.
>>>>>>>>
>>>>>>> The scenario is
>>>>>>
>>>>>> 1. goto basket
>>>>>> 2. goto checkout (Page A in post) enter some data
>>>>>> 3. goback to basket (dfp = false) validation should be bypassed
>>>>>> 4. goto checkout =>    all entered data are present
>>>>>>
>>>>>> But until now with this scenario i lost all data in step 4
>>>>>>
>>>>>> Thanks
>>>>>> Mike
>>>>>>
>>>>>> PS: I use buttons to stay in javascript-less mode :-)
>>>>>>
>>>>>>
>>>>>> ------------------------------****----------------------------**
>>>>>> --**---------
>>>>>> To unsubscribe, e-mail:
>>>>>> users-unsubscribe@wicket.**apa**che.org<http://apache.org>
>>>>>>
>>>>>> <users-unsubscribe@**wicket.apache.org<[hidden email]>
>>>>>> For additional commands, e-mail: [hidden email]
>>>>>>
>>>>>>
>>>>>>  Ajax is not an option - i have to stay javascript-less.
>>>>
>>>>   You want to go back to another page without having to fill the form,
>>>> but
>>>>>
>>>>> you
>>>>>  also don't want to lose data you typed in in the previous screen?
>>>>> Seems
>>>>>  weird to me.
>>>>>
>>>> Not the previous screen. The current screen.
>>>>
>>>> I come from basket. I goto checkout. I start typing. I think oops what
>>>> was
>>>> the option in basket
>>>> and goback to basket (dfp = false). I check the basket option and think
>>>> ok
>>>> let's go on checkout.
>>>> And on checkout i think - damn all typed data have gone. So i leave the
>>>> shop.
>>>>
>>>> That's the scenario i try to catch.
>>>>
>>>>
>>>> Thanks
>>>> Mike
>>>>
>>>>
>>>>
>>>>
>>>> ------------------------------**------------------------------**---------
>>>> To unsubscribe, e-mail:
>>>> users-unsubscribe@wicket.**apache.org<[hidden email]>
>>>> For additional commands, e-mail: [hidden email]
>>>>
>>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Form looses data

Martin Makundi
Actually notesField = localNotesfield = TextArea(...)

**
Martin

2011/8/12 Martin Makundi <[hidden email]>:

> Hi!
>
>> i have some questions for usage of this.
>> 1. Where do i have to put my instance of reusemanager?
>
> Where you want to keep the values? What is your "common denominator".
> It can be a page or it can be in session... I normally use a Panel and
> it keeps values of listview items' formcomponents during ajax rebuild
> of listview.
>
>> 2. What is MarkupUtils.fakeRawInput and MarkupUtils.replaceReporter doing?
>
>
>      rawInputField = FormComponent.class.getDeclaredField("rawInput");
>      rawInputField.setAccessible(true);
>      reporterField = FeedbackMessage.class.getDeclaredField("reporter");
>      reporterField.setAccessible(true);
>
> /**
>   * @param formComponent
>   * @param <T>
>   * @param existingComponent
>   */
>  public static <T extends FormComponent<?>> void fakeRawInput(T
> formComponent, T existingComponent) {
>    try {
>      String rawInput = (String) rawInputField.get(existingComponent);
>      fakeRawInput(formComponent, rawInput);
>    } catch (Exception e) {
>      Utils.errorLog(WicketUtils.class, "Fatal Error: Form field
> access failed.", e);
>    }
>  }
>
> /**
>   * @param formComponent
>   * @param <T>
>   * @param value
>   */
>  public static <T extends FormComponent<?>> void fakeRawInput(T
> formComponent, String value) {
>    try {
>      rawInputField.set(formComponent, value);
>    } catch (Exception e) {
>      Utils.errorLog(WicketUtils.class, "Fatal Error: Form field
> access failed.", e);
>    }
>  }
>
> /**
>   * @param feedbackMessage
>   * @param formComponent
>   */
>  public static void replaceReporter(FeedbackMessage feedbackMessage,
> FormComponent<?> formComponent) {
>    try {
>      reporterField.set(feedbackMessage, formComponent);
>    } catch (Exception e) {
>      throw new RuntimeException(e);
>    }
>  }
>
>> 3. I don't have any persistent id (rowid) for usage.
>
> Rowid can be something which is unique for each component. In listview
> it is the item model object. If you don't have rows, it can be
> something else, even a string index or component id or something.
> Depends what you are making and how complex your page is.
>
>> 4. Do you have a working example for me?
>
> It's quite simple, really. Here are two examples one with string index
> and another with model object id:
>
> {
>  //  A
>         String taskIndex = dailyContainer.getIndex() + ":task." +
> reuseManager.getUniqueIndex(task);
>
>                  notesField = reuseManager.rememberOrReuse(taskIndex, NOTES_TD,
>                      localNotesField);
>
>                  notesContainer.add(notesField);
>
> }
>
> {
>  // B
>    protected void populateItem(final ListItem<Vacation> rowItem) {
>      SqlDateTextField startDateField;
>        startDateField = reuseManager.rememberOrReuse(vacation,
> START_DATE, startDateField);
>        rowItem.add(startDateField.setRequired(true));
>
> }
>
>
>
> Ah yes, and you might want to call reuseManager.clear if you want to
> reset your context (similar to form.clearInput())
>
> **
> Martin
>
>
> **
> Martin
>
>>
>> Thanks
>> Mike
>>
>>> Is possible using reuseManager, but you need to keep reference to it
>>> somewhere.
>>>
>>>
>>> http://apache-wicket.1842946.n4.nabble.com/Check-box-loses-checked-state-after-error-td1855690.html
>>>
>>> **
>>> Martin
>>>
>>> 2011/8/11 Bruno Borges<[hidden email]>:
>>>>
>>>> In your GoBack button's submit method (dpf = false), call
>>>>
>>>>   form.updateFormComponentModels()
>>>>
>>>>
>>>>
>>>> *Bruno Borges *
>>>> www.brunoborges.com.br
>>>> +55 21 76727099
>>>>
>>>>
>>>>
>>>> On Thu, Aug 11, 2011 at 12:08 PM, Mike Mander<[hidden email]>  wrote:
>>>>
>>>>> Am 11.08.2011 16:54, schrieb Bruno Borges:
>>>>>
>>>>>> You want to go back to another page without having to fill the form,
>>>>>> but
>>>>>> you
>>>>>> also don't want to lose data you typed in in the previous screen? Seems
>>>>>> weird to me.
>>>>>>
>>>>>> Have you considered to add Ajax update behaviour? onBlur of components,
>>>>>> you
>>>>>> could update the model of each component.
>>>>>> *Bruno Borges*
>>>>>> www.brunoborges.com.br
>>>>>> +55 21 76727099
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Thu, Aug 11, 2011 at 11:50 AM, Mike Mander<[hidden email]>
>>>>>>  wrote:
>>>>>>
>>>>>>  Am 11.08.2011 16:36, schrieb Bruno Borges:
>>>>>>>
>>>>>>>  Shouldn't you be submitting that button anyway? dfp = true
>>>>>>>>
>>>>>>>> *Bruno Borges*
>>>>>>>> www.brunoborges.com.br
>>>>>>>> +55 21 76727099
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> On Thu, Aug 11, 2011 at 10:44 AM, Mike Mander<[hidden email]>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>  Hi,
>>>>>>>>
>>>>>>>>> i've added a domain model globally to my session.
>>>>>>>>>
>>>>>>>>> A form for editing this data is provided on page A. On this i have 2
>>>>>>>>> submit
>>>>>>>>> buttons. One with setDefaultFormProcessing false (to previous page)
>>>>>>>>> and
>>>>>>>>> one
>>>>>>>>> with true (to next step).
>>>>>>>>>
>>>>>>>>> If i press the main submit (next step | dfp = true) then everything
>>>>>>>>> works
>>>>>>>>> as expected. If i press the other (previous page |dfp = false) and
>>>>>>>>> redirect
>>>>>>>>> to Page A all data are lost. I'm absolutely aware of the issue that
>>>>>>>>> false
>>>>>>>>> in
>>>>>>>>> defaultFormProcessing is not submitting the data.
>>>>>>>>>
>>>>>>>>> But because i cannot reproduce the input changed part of the form
>>>>>>>>> processing, i can't submit the invalid data manually. Is there any
>>>>>>>>> way
>>>>>>>>> to
>>>>>>>>> achieve my goal?
>>>>>>>>>
>>>>>>>>> Thanks
>>>>>>>>> Mike
>>>>>>>>>
>>>>>>>>> ------------------------------******--------------------------**--**
>>>>>>>>> --**---------
>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.****apa**che.org<
>>>>>>>>> http://apache.org**>
>>>>>>>>> <users-unsubscribe@**wicket.**apache.org<http://wicket.apache.org><
>>>>>>>>>
>>>>>>>>> users-unsubscribe@**wicket.apache.org<[hidden email]>
>>>>>>>>> For additional commands, e-mail: [hidden email]
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>  Then i can't goback to previous page without filling the form.
>>>>>>>>>
>>>>>>>> The scenario is
>>>>>>>
>>>>>>> 1. goto basket
>>>>>>> 2. goto checkout (Page A in post) enter some data
>>>>>>> 3. goback to basket (dfp = false) validation should be bypassed
>>>>>>> 4. goto checkout =>    all entered data are present
>>>>>>>
>>>>>>> But until now with this scenario i lost all data in step 4
>>>>>>>
>>>>>>> Thanks
>>>>>>> Mike
>>>>>>>
>>>>>>> PS: I use buttons to stay in javascript-less mode :-)
>>>>>>>
>>>>>>>
>>>>>>> ------------------------------****----------------------------**
>>>>>>> --**---------
>>>>>>> To unsubscribe, e-mail:
>>>>>>> users-unsubscribe@wicket.**apa**che.org<http://apache.org>
>>>>>>>
>>>>>>> <users-unsubscribe@**wicket.apache.org<[hidden email]>
>>>>>>> For additional commands, e-mail: [hidden email]
>>>>>>>
>>>>>>>
>>>>>>>  Ajax is not an option - i have to stay javascript-less.
>>>>>
>>>>>   You want to go back to another page without having to fill the form,
>>>>> but
>>>>>>
>>>>>> you
>>>>>>  also don't want to lose data you typed in in the previous screen?
>>>>>> Seems
>>>>>>  weird to me.
>>>>>>
>>>>> Not the previous screen. The current screen.
>>>>>
>>>>> I come from basket. I goto checkout. I start typing. I think oops what
>>>>> was
>>>>> the option in basket
>>>>> and goback to basket (dfp = false). I check the basket option and think
>>>>> ok
>>>>> let's go on checkout.
>>>>> And on checkout i think - damn all typed data have gone. So i leave the
>>>>> shop.
>>>>>
>>>>> That's the scenario i try to catch.
>>>>>
>>>>>
>>>>> Thanks
>>>>> Mike
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> ------------------------------**------------------------------**---------
>>>>> To unsubscribe, e-mail:
>>>>> users-unsubscribe@wicket.**apache.org<[hidden email]>
>>>>> For additional commands, e-mail: [hidden email]
>>>>>
>>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Form looses data

Mike Mander
In reply to this post by Bruno Borges
That is not working to. I've created a quickstart for this.
Scenario is simplified. HomePage gets the data and has two submit buttons.
Do i press the "submit" and click back on other page data are present
(submitted).
Do i press the "invalid submit" and click back on other page data are lost.

Here is the code

DirtyForm.java
<code>
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.model.IModel;

public class DirtyForm<T> extends Form<T> {

     public DirtyForm(String id, IModel<T> model) {
         super(id, model);
     }

     public final void submitTheInvalidDataToMySession() {
        //this seems not to be the complete solution
        updateFormComponentModels();
     }
}
</code>

HomePage.java
<code>

import org.apache.wicket.PageParameters;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.form.Button;
import org.apache.wicket.markup.html.form.TextField;
import org.apache.wicket.model.PropertyModel;

public class HomePage extends WebPage {

     public HomePage(final PageParameters parameters) {

         DirtyForm<String> form;
         add(form = new DirtyForm<String>("form", new
PropertyModel<String>(new PropertyModel<Object>(this, "session"),
"myBusinessValue"));
         form.add(new TextField<String>("tf", form.getModel()));
         form.add(new Button("doMemorizeInvalidData") {
             @Override
             public void onSubmit() {
                 super.onSubmit();
                 DirtyForm<?> f = findParent(DirtyForm.class);
                 f.submitTheInvalidDataToMySession();
                 setResponsePage(OtherPage.class);
                 setRedirect(true);
             };
         }.setDefaultFormProcessing(false));
         form.add(new Button("doUpdateData") {
             @Override
             public void onSubmit() {
                 super.onSubmit();
                 setResponsePage(OtherPage.class);
                 setRedirect(true);
             };
         });
     }
}
</code>

HomePage.html
<code>
<html
xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd"
 >
<head>
<title>Wicket Quickstart Archetype Homepage</title>
</head>
<body>
<strong>Wicket Quickstart Archetype Homepage</strong>
<br/><br/>
<div>
<form wicket:id="form">
                 Value:
<input type="text" wicket:id="tf" />
<input type="submit" wicket:id="doMemorizeInvalidData" value="invalid
submit" />
<input type="submit" wicket:id="doUpdateData" value="submit" />
</form>
</div>
</body>
</html>
</code>

MySession.java
<code>
import org.apache.wicket.Request;
import org.apache.wicket.protocol.http.WebSession;

public class MySession extends WebSession {

     private String myBusinessValue = null;

     public MySession(Request request) {
         super(request);
     }

     public void setMyBusinessValue(String myBusinessValue) {
         this.myBusinessValue = myBusinessValue;
     }

     public String getMyBusinessValue() {
         return myBusinessValue;
     }
}
</code>

OtherPage.java
<code>
import org.apache.wicket.markup.html.WebPage;

public class OtherPage extends WebPage {

     public OtherPage() {
     }
}
</code>

OtherPage.html
<code>
<html
xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd"
 >
<head>
<title>Wicket Quickstart Archetype Homepage</title>
</head>
<body>
<strong>Wicket Quickstart Archetype Homepage</strong>
<br/><br/>
<a href="/">Back</a>
</body>
</html>
</code>

WicketApplication.java
<code>
import org.apache.wicket.Request;
import org.apache.wicket.Response;
import org.apache.wicket.Session;
import org.apache.wicket.protocol.http.WebApplication;

public class WicketApplication extends WebApplication {
     @Override
     public Class<HomePage> getHomePage() {
         return HomePage.class;
     }

     @Override
     public Session newSession(Request request, Response response) {
         return new MySession(request);
     }
}
</code>

> In your GoBack button's submit method (dpf = false), call
>
>     form.updateFormComponentModels()
>
>
>
> *Bruno Borges *
> www.brunoborges.com.br
> +55 21 76727099
>
>
>
> On Thu, Aug 11, 2011 at 12:08 PM, Mike Mander<[hidden email]>  wrote:
>
>> Am 11.08.2011 16:54, schrieb Bruno Borges:
>>
>>> You want to go back to another page without having to fill the form, but
>>> you
>>> also don't want to lose data you typed in in the previous screen? Seems
>>> weird to me.
>>>
>>> Have you considered to add Ajax update behaviour? onBlur of components,
>>> you
>>> could update the model of each component.
>>> *Bruno Borges*
>>> www.brunoborges.com.br
>>> +55 21 76727099
>>>
>>>
>>>
>>> On Thu, Aug 11, 2011 at 11:50 AM, Mike Mander<[hidden email]>   wrote:
>>>
>>>   Am 11.08.2011 16:36, schrieb Bruno Borges:
>>>>   Shouldn't you be submitting that button anyway? dfp = true
>>>>>
>>>>> *Bruno Borges*
>>>>> www.brunoborges.com.br
>>>>> +55 21 76727099
>>>>>
>>>>>
>>>>>
>>>>> On Thu, Aug 11, 2011 at 10:44 AM, Mike Mander<[hidden email]>
>>>>> wrote:
>>>>>
>>>>>   Hi,
>>>>>
>>>>>> i've added a domain model globally to my session.
>>>>>>
>>>>>> A form for editing this data is provided on page A. On this i have 2
>>>>>> submit
>>>>>> buttons. One with setDefaultFormProcessing false (to previous page) and
>>>>>> one
>>>>>> with true (to next step).
>>>>>>
>>>>>> If i press the main submit (next step | dfp = true) then everything
>>>>>> works
>>>>>> as expected. If i press the other (previous page |dfp = false) and
>>>>>> redirect
>>>>>> to Page A all data are lost. I'm absolutely aware of the issue that
>>>>>> false
>>>>>> in
>>>>>> defaultFormProcessing is not submitting the data.
>>>>>>
>>>>>> But because i cannot reproduce the input changed part of the form
>>>>>> processing, i can't submit the invalid data manually. Is there any way
>>>>>> to
>>>>>> achieve my goal?
>>>>>>
>>>>>> Thanks
>>>>>> Mike
>>>>>>
>>>>>> ------------------------------******--------------------------**--**
>>>>>> --**---------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.****apa**che.org<
>>>>>> http://apache.org**>
>>>>>> <users-unsubscribe@**wicket.**apache.org<http://wicket.apache.org><
>>>>>> users-unsubscribe@**wicket.apache.org<[hidden email]>
>>>>>> For additional commands, e-mail: [hidden email]
>>>>>>
>>>>>>
>>>>>>   Then i can't goback to previous page without filling the form.
>>>>>>
>>>>> The scenario is
>>>> 1. goto basket
>>>> 2. goto checkout (Page A in post) enter some data
>>>> 3. goback to basket (dfp = false) validation should be bypassed
>>>> 4. goto checkout =>   all entered data are present
>>>>
>>>> But until now with this scenario i lost all data in step 4
>>>>
>>>> Thanks
>>>> Mike
>>>>
>>>> PS: I use buttons to stay in javascript-less mode :-)
>>>>
>>>>
>>>> ------------------------------****----------------------------**
>>>> --**---------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.**apa**che.org<http://apache.org>
>>>> <users-unsubscribe@**wicket.apache.org<[hidden email]>
>>>> For additional commands, e-mail: [hidden email]
>>>>
>>>>
>>>>   Ajax is not an option - i have to stay javascript-less.
>>
>>    You want to go back to another page without having to fill the form, but
>>> you
>>>   also don't want to lose data you typed in in the previous screen? Seems
>>>   weird to me.
>>>
>> Not the previous screen. The current screen.
>>
>> I come from basket. I goto checkout. I start typing. I think oops what was
>> the option in basket
>> and goback to basket (dfp = false). I check the basket option and think ok
>> let's go on checkout.
>> And on checkout i think - damn all typed data have gone. So i leave the
>> shop.
>>
>> That's the scenario i try to catch.
>>
>>
>> Thanks
>> Mike
>>
>>
>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.org<[hidden email]>
>> For additional commands, e-mail: [hidden email]
>>
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Form looses data

Martin Makundi
This is how you can do it with reusemanager:


HomePage:
public class HomePage extends WebPage {
        public HomePage(final PageParameters parameters) {
       Form<Void> form;
                        add(form = new Form<Void>("form"));
       form.add(WicketSession.get().getReuseManager().rememberOrReuseAndProvideFeedback(HomePage.class.getSimpleName()
+ "tf", new TextField<String>("tf", Model.of(""))));
       form.add(new Button("doMemorizeInvalidData") {
           @Override
           public void onSubmit() {
               super.onSubmit();
               setResponsePage(OtherPage.class);
               setRedirect(true);
           };
       }.setDefaultFormProcessing(false));
       form.add(new Button("doUpdateData") {
           @Override
           public void onSubmit() {
               super.onSubmit();
               setResponsePage(OtherPage.class);
               setRedirect(true);
           };
       });
   }
}


Reusemanager holder (can be session, can be something else):

public class WicketSession extends WebSession {
        /**
         *
         */
        private static final long serialVersionUID = 1L;
       
        private final FormComponentReuseManager reuseManager = new
FormComponentReuseManager();

        public FormComponentReuseManager getReuseManager() {
                return reuseManager;
        }

        /**
         * @param request
         */
        public WicketSession(Request request) {
                super(request);
        }

        /**
         * @return WicketSession
         */
        public static WicketSession get() {
                return (WicketSession) Session.get();
        }
}


**
Martin

2011/8/12 Mike Mander <[hidden email]>:

> That is not working to. I've created a quickstart for this.
> Scenario is simplified. HomePage gets the data and has two submit buttons.
> Do i press the "submit" and click back on other page data are present
> (submitted).
> Do i press the "invalid submit" and click back on other page data are lost.
>
> Here is the code
>
> DirtyForm.java
> <code>
> import org.apache.wicket.markup.html.form.Form;
> import org.apache.wicket.model.IModel;
>
> public class DirtyForm<T> extends Form<T> {
>
>    public DirtyForm(String id, IModel<T> model) {
>        super(id, model);
>    }
>
>    public final void submitTheInvalidDataToMySession() {
>       //this seems not to be the complete solution
>       updateFormComponentModels();
>    }
> }
> </code>
>
> HomePage.java
> <code>
>
> import org.apache.wicket.PageParameters;
> import org.apache.wicket.markup.html.WebPage;
> import org.apache.wicket.markup.html.form.Button;
> import org.apache.wicket.markup.html.form.TextField;
> import org.apache.wicket.model.PropertyModel;
>
> public class HomePage extends WebPage {
>
>    public HomePage(final PageParameters parameters) {
>
>        DirtyForm<String> form;
>        add(form = new DirtyForm<String>("form", new
> PropertyModel<String>(new PropertyModel<Object>(this, "session"),
> "myBusinessValue"));
>        form.add(new TextField<String>("tf", form.getModel()));
>        form.add(new Button("doMemorizeInvalidData") {
>            @Override
>            public void onSubmit() {
>                super.onSubmit();
>                DirtyForm<?> f = findParent(DirtyForm.class);
>                f.submitTheInvalidDataToMySession();
>                setResponsePage(OtherPage.class);
>                setRedirect(true);
>            };
>        }.setDefaultFormProcessing(false));
>        form.add(new Button("doUpdateData") {
>            @Override
>            public void onSubmit() {
>                super.onSubmit();
>                setResponsePage(OtherPage.class);
>                setRedirect(true);
>            };
>        });
>    }
> }
> </code>
>
> HomePage.html
> <code>
> <html
> xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd"
>>
> <head>
> <title>Wicket Quickstart Archetype Homepage</title>
> </head>
> <body>
> <strong>Wicket Quickstart Archetype Homepage</strong>
> <br/><br/>
> <div>
> <form wicket:id="form">
>                Value:
> <input type="text" wicket:id="tf" />
> <input type="submit" wicket:id="doMemorizeInvalidData" value="invalid
> submit" />
> <input type="submit" wicket:id="doUpdateData" value="submit" />
> </form>
> </div>
> </body>
> </html>
> </code>
>
> MySession.java
> <code>
> import org.apache.wicket.Request;
> import org.apache.wicket.protocol.http.WebSession;
>
> public class MySession extends WebSession {
>
>    private String myBusinessValue = null;
>
>    public MySession(Request request) {
>        super(request);
>    }
>
>    public void setMyBusinessValue(String myBusinessValue) {
>        this.myBusinessValue = myBusinessValue;
>    }
>
>    public String getMyBusinessValue() {
>        return myBusinessValue;
>    }
> }
> </code>
>
> OtherPage.java
> <code>
> import org.apache.wicket.markup.html.WebPage;
>
> public class OtherPage extends WebPage {
>
>    public OtherPage() {
>    }
> }
> </code>
>
> OtherPage.html
> <code>
> <html
> xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd"
>>
> <head>
> <title>Wicket Quickstart Archetype Homepage</title>
> </head>
> <body>
> <strong>Wicket Quickstart Archetype Homepage</strong>
> <br/><br/>
> <a href="/">Back</a>
> </body>
> </html>
> </code>
>
> WicketApplication.java
> <code>
> import org.apache.wicket.Request;
> import org.apache.wicket.Response;
> import org.apache.wicket.Session;
> import org.apache.wicket.protocol.http.WebApplication;
>
> public class WicketApplication extends WebApplication {
>    @Override
>    public Class<HomePage> getHomePage() {
>        return HomePage.class;
>    }
>
>    @Override
>    public Session newSession(Request request, Response response) {
>        return new MySession(request);
>    }
> }
> </code>
>
>> In your GoBack button's submit method (dpf = false), call
>>
>>    form.updateFormComponentModels()
>>
>>
>>
>> *Bruno Borges *
>> www.brunoborges.com.br
>> +55 21 76727099
>>
>>
>>
>> On Thu, Aug 11, 2011 at 12:08 PM, Mike Mander<[hidden email]>  wrote:
>>
>>> Am 11.08.2011 16:54, schrieb Bruno Borges:
>>>
>>>> You want to go back to another page without having to fill the form, but
>>>> you
>>>> also don't want to lose data you typed in in the previous screen? Seems
>>>> weird to me.
>>>>
>>>> Have you considered to add Ajax update behaviour? onBlur of components,
>>>> you
>>>> could update the model of each component.
>>>> *Bruno Borges*
>>>> www.brunoborges.com.br
>>>> +55 21 76727099
>>>>
>>>>
>>>>
>>>> On Thu, Aug 11, 2011 at 11:50 AM, Mike Mander<[hidden email]>
>>>> wrote:
>>>>
>>>>  Am 11.08.2011 16:36, schrieb Bruno Borges:
>>>>>
>>>>>  Shouldn't you be submitting that button anyway? dfp = true
>>>>>>
>>>>>> *Bruno Borges*
>>>>>> www.brunoborges.com.br
>>>>>> +55 21 76727099
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Thu, Aug 11, 2011 at 10:44 AM, Mike Mander<[hidden email]>
>>>>>> wrote:
>>>>>>
>>>>>>  Hi,
>>>>>>
>>>>>>> i've added a domain model globally to my session.
>>>>>>>
>>>>>>> A form for editing this data is provided on page A. On this i have 2
>>>>>>> submit
>>>>>>> buttons. One with setDefaultFormProcessing false (to previous page)
>>>>>>> and
>>>>>>> one
>>>>>>> with true (to next step).
>>>>>>>
>>>>>>> If i press the main submit (next step | dfp = true) then everything
>>>>>>> works
>>>>>>> as expected. If i press the other (previous page |dfp = false) and
>>>>>>> redirect
>>>>>>> to Page A all data are lost. I'm absolutely aware of the issue that
>>>>>>> false
>>>>>>> in
>>>>>>> defaultFormProcessing is not submitting the data.
>>>>>>>
>>>>>>> But because i cannot reproduce the input changed part of the form
>>>>>>> processing, i can't submit the invalid data manually. Is there any
>>>>>>> way
>>>>>>> to
>>>>>>> achieve my goal?
>>>>>>>
>>>>>>> Thanks
>>>>>>> Mike
>>>>>>>
>>>>>>> ------------------------------******--------------------------**--**
>>>>>>> --**---------
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.****apa**che.org<
>>>>>>> http://apache.org**>
>>>>>>> <users-unsubscribe@**wicket.**apache.org<http://wicket.apache.org><
>>>>>>>
>>>>>>> users-unsubscribe@**wicket.apache.org<[hidden email]>
>>>>>>> For additional commands, e-mail: [hidden email]
>>>>>>>
>>>>>>>
>>>>>>>  Then i can't goback to previous page without filling the form.
>>>>>>>
>>>>>> The scenario is
>>>>>
>>>>> 1. goto basket
>>>>> 2. goto checkout (Page A in post) enter some data
>>>>> 3. goback to basket (dfp = false) validation should be bypassed
>>>>> 4. goto checkout =>   all entered data are present
>>>>>
>>>>> But until now with this scenario i lost all data in step 4
>>>>>
>>>>> Thanks
>>>>> Mike
>>>>>
>>>>> PS: I use buttons to stay in javascript-less mode :-)
>>>>>
>>>>>
>>>>> ------------------------------****----------------------------**
>>>>> --**---------
>>>>> To unsubscribe, e-mail:
>>>>> users-unsubscribe@wicket.**apa**che.org<http://apache.org>
>>>>>
>>>>> <users-unsubscribe@**wicket.apache.org<[hidden email]>
>>>>> For additional commands, e-mail: [hidden email]
>>>>>
>>>>>
>>>>>  Ajax is not an option - i have to stay javascript-less.
>>>
>>>   You want to go back to another page without having to fill the form,
>>> but
>>>>
>>>> you
>>>>  also don't want to lose data you typed in in the previous screen? Seems
>>>>  weird to me.
>>>>
>>> Not the previous screen. The current screen.
>>>
>>> I come from basket. I goto checkout. I start typing. I think oops what
>>> was
>>> the option in basket
>>> and goback to basket (dfp = false). I check the basket option and think
>>> ok
>>> let's go on checkout.
>>> And on checkout i think - damn all typed data have gone. So i leave the
>>> shop.
>>>
>>> That's the scenario i try to catch.
>>>
>>>
>>> Thanks
>>> Mike
>>>
>>>
>>>
>>> ------------------------------**------------------------------**---------
>>> To unsubscribe, e-mail:
>>> users-unsubscribe@wicket.**apache.org<[hidden email]>
>>> For additional commands, e-mail: [hidden email]
>>>
>>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Form looses data

Mike Mander
Thanks Martin,

now it works as expected. I don't have a clue how but it is.
I really would be interested in knowing why the reusemanager gets the
data and the form not.

I think i will start a debugging session at weekend :-)

Maybe we should use this scenario and put it in the wiki? Especially in
shop environments it's
a big frustration point if form values is lost only because i want to
see what i typed in last page.
And ask the user to provide all data until validation passes is
decreasing the conversion rate :-(
So maybe others will benefit from the found / working solution to.

Thanks again
Mike

> This is how you can do it with reusemanager:
>
>
> HomePage:
> public class HomePage extends WebPage {
> public HomePage(final PageParameters parameters) {
>         Form<Void>  form;
> add(form = new Form<Void>("form"));
>         form.add(WicketSession.get().getReuseManager().rememberOrReuseAndProvideFeedback(HomePage.class.getSimpleName()
> + "tf", new TextField<String>("tf", Model.of(""))));
>         form.add(new Button("doMemorizeInvalidData") {
>             @Override
>             public void onSubmit() {
>                 super.onSubmit();
>                 setResponsePage(OtherPage.class);
>                 setRedirect(true);
>             };
>         }.setDefaultFormProcessing(false));
>         form.add(new Button("doUpdateData") {
>             @Override
>             public void onSubmit() {
>                 super.onSubmit();
>                 setResponsePage(OtherPage.class);
>                 setRedirect(true);
>             };
>         });
>     }
> }
>
>
> Reusemanager holder (can be session, can be something else):
>
> public class WicketSession extends WebSession {
> /**
> *
> */
> private static final long serialVersionUID = 1L;
>
> private final FormComponentReuseManager reuseManager = new
> FormComponentReuseManager();
>
> public FormComponentReuseManager getReuseManager() {
> return reuseManager;
> }
>
> /**
> * @param request
> */
> public WicketSession(Request request) {
> super(request);
> }
>
> /**
> * @return WicketSession
> */
> public static WicketSession get() {
> return (WicketSession) Session.get();
> }
> }
>
>
> **
> Martin
>
> 2011/8/12 Mike Mander<[hidden email]>:
>> That is not working to. I've created a quickstart for this.
>> Scenario is simplified. HomePage gets the data and has two submit buttons.
>> Do i press the "submit" and click back on other page data are present
>> (submitted).
>> Do i press the "invalid submit" and click back on other page data are lost.
>>
>> Here is the code
>>
>> DirtyForm.java
>> <code>
>> import org.apache.wicket.markup.html.form.Form;
>> import org.apache.wicket.model.IModel;
>>
>> public class DirtyForm<T>  extends Form<T>  {
>>
>>     public DirtyForm(String id, IModel<T>  model) {
>>         super(id, model);
>>     }
>>
>>     public final void submitTheInvalidDataToMySession() {
>>        //this seems not to be the complete solution
>>        updateFormComponentModels();
>>     }
>> }
>> </code>
>>
>> HomePage.java
>> <code>
>>
>> import org.apache.wicket.PageParameters;
>> import org.apache.wicket.markup.html.WebPage;
>> import org.apache.wicket.markup.html.form.Button;
>> import org.apache.wicket.markup.html.form.TextField;
>> import org.apache.wicket.model.PropertyModel;
>>
>> public class HomePage extends WebPage {
>>
>>     public HomePage(final PageParameters parameters) {
>>
>>         DirtyForm<String>  form;
>>         add(form = new DirtyForm<String>("form", new
>> PropertyModel<String>(new PropertyModel<Object>(this, "session"),
>> "myBusinessValue"));
>>         form.add(new TextField<String>("tf", form.getModel()));
>>         form.add(new Button("doMemorizeInvalidData") {
>>             @Override
>>             public void onSubmit() {
>>                 super.onSubmit();
>>                 DirtyForm<?>  f = findParent(DirtyForm.class);
>>                 f.submitTheInvalidDataToMySession();
>>                 setResponsePage(OtherPage.class);
>>                 setRedirect(true);
>>             };
>>         }.setDefaultFormProcessing(false));
>>         form.add(new Button("doUpdateData") {
>>             @Override
>>             public void onSubmit() {
>>                 super.onSubmit();
>>                 setResponsePage(OtherPage.class);
>>                 setRedirect(true);
>>             };
>>         });
>>     }
>> }
>> </code>
>>
>> HomePage.html
>> <code>
>> <html
>> xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd"
>> <head>
>> <title>Wicket Quickstart Archetype Homepage</title>
>> </head>
>> <body>
>> <strong>Wicket Quickstart Archetype Homepage</strong>
>> <br/><br/>
>> <div>
>> <form wicket:id="form">
>>                 Value:
>> <input type="text" wicket:id="tf" />
>> <input type="submit" wicket:id="doMemorizeInvalidData" value="invalid
>> submit" />
>> <input type="submit" wicket:id="doUpdateData" value="submit" />
>> </form>
>> </div>
>> </body>
>> </html>
>> </code>
>>
>> MySession.java
>> <code>
>> import org.apache.wicket.Request;
>> import org.apache.wicket.protocol.http.WebSession;
>>
>> public class MySession extends WebSession {
>>
>>     private String myBusinessValue = null;
>>
>>     public MySession(Request request) {
>>         super(request);
>>     }
>>
>>     public void setMyBusinessValue(String myBusinessValue) {
>>         this.myBusinessValue = myBusinessValue;
>>     }
>>
>>     public String getMyBusinessValue() {
>>         return myBusinessValue;
>>     }
>> }
>> </code>
>>
>> OtherPage.java
>> <code>
>> import org.apache.wicket.markup.html.WebPage;
>>
>> public class OtherPage extends WebPage {
>>
>>     public OtherPage() {
>>     }
>> }
>> </code>
>>
>> OtherPage.html
>> <code>
>> <html
>> xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd"
>> <head>
>> <title>Wicket Quickstart Archetype Homepage</title>
>> </head>
>> <body>
>> <strong>Wicket Quickstart Archetype Homepage</strong>
>> <br/><br/>
>> <a href="/">Back</a>
>> </body>
>> </html>
>> </code>
>>
>> WicketApplication.java
>> <code>
>> import org.apache.wicket.Request;
>> import org.apache.wicket.Response;
>> import org.apache.wicket.Session;
>> import org.apache.wicket.protocol.http.WebApplication;
>>
>> public class WicketApplication extends WebApplication {
>>     @Override
>>     public Class<HomePage>  getHomePage() {
>>         return HomePage.class;
>>     }
>>
>>     @Override
>>     public Session newSession(Request request, Response response) {
>>         return new MySession(request);
>>     }
>> }
>> </code>
>>
>>> In your GoBack button's submit method (dpf = false), call
>>>
>>>     form.updateFormComponentModels()
>>>
>>>
>>>
>>> *Bruno Borges *
>>> www.brunoborges.com.br
>>> +55 21 76727099
>>>
>>>
>>>
>>> On Thu, Aug 11, 2011 at 12:08 PM, Mike Mander<[hidden email]>    wrote:
>>>
>>>> Am 11.08.2011 16:54, schrieb Bruno Borges:
>>>>
>>>>> You want to go back to another page without having to fill the form, but
>>>>> you
>>>>> also don't want to lose data you typed in in the previous screen? Seems
>>>>> weird to me.
>>>>>
>>>>> Have you considered to add Ajax update behaviour? onBlur of components,
>>>>> you
>>>>> could update the model of each component.
>>>>> *Bruno Borges*
>>>>> www.brunoborges.com.br
>>>>> +55 21 76727099
>>>>>
>>>>>
>>>>>
>>>>> On Thu, Aug 11, 2011 at 11:50 AM, Mike Mander<[hidden email]>
>>>>> wrote:
>>>>>
>>>>>   Am 11.08.2011 16:36, schrieb Bruno Borges:
>>>>>>   Shouldn't you be submitting that button anyway? dfp = true
>>>>>>> *Bruno Borges*
>>>>>>> www.brunoborges.com.br
>>>>>>> +55 21 76727099
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Thu, Aug 11, 2011 at 10:44 AM, Mike Mander<[hidden email]>
>>>>>>> wrote:
>>>>>>>
>>>>>>>   Hi,
>>>>>>>
>>>>>>>> i've added a domain model globally to my session.
>>>>>>>>
>>>>>>>> A form for editing this data is provided on page A. On this i have 2
>>>>>>>> submit
>>>>>>>> buttons. One with setDefaultFormProcessing false (to previous page)
>>>>>>>> and
>>>>>>>> one
>>>>>>>> with true (to next step).
>>>>>>>>
>>>>>>>> If i press the main submit (next step | dfp = true) then everything
>>>>>>>> works
>>>>>>>> as expected. If i press the other (previous page |dfp = false) and
>>>>>>>> redirect
>>>>>>>> to Page A all data are lost. I'm absolutely aware of the issue that
>>>>>>>> false
>>>>>>>> in
>>>>>>>> defaultFormProcessing is not submitting the data.
>>>>>>>>
>>>>>>>> But because i cannot reproduce the input changed part of the form
>>>>>>>> processing, i can't submit the invalid data manually. Is there any
>>>>>>>> way
>>>>>>>> to
>>>>>>>> achieve my goal?
>>>>>>>>
>>>>>>>> Thanks
>>>>>>>> Mike
>>>>>>>>
>>>>>>>> ------------------------------******--------------------------**--**
>>>>>>>> --**---------
>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.****apa**che.org<
>>>>>>>> http://apache.org**>
>>>>>>>> <users-unsubscribe@**wicket.**apache.org<http://wicket.apache.org><
>>>>>>>>
>>>>>>>> users-unsubscribe@**wicket.apache.org<[hidden email]>
>>>>>>>> For additional commands, e-mail: [hidden email]
>>>>>>>>
>>>>>>>>
>>>>>>>>   Then i can't goback to previous page without filling the form.
>>>>>>>>
>>>>>>> The scenario is
>>>>>> 1. goto basket
>>>>>> 2. goto checkout (Page A in post) enter some data
>>>>>> 3. goback to basket (dfp = false) validation should be bypassed
>>>>>> 4. goto checkout =>     all entered data are present
>>>>>>
>>>>>> But until now with this scenario i lost all data in step 4
>>>>>>
>>>>>> Thanks
>>>>>> Mike
>>>>>>
>>>>>> PS: I use buttons to stay in javascript-less mode :-)
>>>>>>
>>>>>>
>>>>>> ------------------------------****----------------------------**
>>>>>> --**---------
>>>>>> To unsubscribe, e-mail:
>>>>>> users-unsubscribe@wicket.**apa**che.org<http://apache.org>
>>>>>>
>>>>>> <users-unsubscribe@**wicket.apache.org<[hidden email]>
>>>>>> For additional commands, e-mail: [hidden email]
>>>>>>
>>>>>>
>>>>>>   Ajax is not an option - i have to stay javascript-less.
>>>>    You want to go back to another page without having to fill the form,
>>>> but
>>>>> you
>>>>>   also don't want to lose data you typed in in the previous screen? Seems
>>>>>   weird to me.
>>>>>
>>>> Not the previous screen. The current screen.
>>>>
>>>> I come from basket. I goto checkout. I start typing. I think oops what
>>>> was
>>>> the option in basket
>>>> and goback to basket (dfp = false). I check the basket option and think
>>>> ok
>>>> let's go on checkout.
>>>> And on checkout i think - damn all typed data have gone. So i leave the
>>>> shop.
>>>>
>>>> That's the scenario i try to catch.
>>>>
>>>>
>>>> Thanks
>>>> Mike
>>>>
>>>>
>>>>
>>>> ------------------------------**------------------------------**---------
>>>> To unsubscribe, e-mail:
>>>> users-unsubscribe@wicket.**apache.org<[hidden email]>
>>>> For additional commands, e-mail: [hidden email]
>>>>
>>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Form looses data

Martin Makundi
The Form way is a quirk way to do it in the first place. You are not
supposed to update model before validation etc. so you will run into
lots of troubles that way.

Reusemanager simply works like wicket normally works when you validate
and repaint the screen with rawInput values. It just keeps those
components and copies the old rawInput value which was persisted
during incomplete submit.

**
Martin

2011/8/12 Mike Mander <[hidden email]>:

> Thanks Martin,
>
> now it works as expected. I don't have a clue how but it is.
> I really would be interested in knowing why the reusemanager gets the data
> and the form not.
>
> I think i will start a debugging session at weekend :-)
>
> Maybe we should use this scenario and put it in the wiki? Especially in shop
> environments it's
> a big frustration point if form values is lost only because i want to see
> what i typed in last page.
> And ask the user to provide all data until validation passes is decreasing
> the conversion rate :-(
> So maybe others will benefit from the found / working solution to.
>
> Thanks again
> Mike
>
>> This is how you can do it with reusemanager:
>>
>>
>> HomePage:
>> public class HomePage extends WebPage {
>>        public HomePage(final PageParameters parameters) {
>>        Form<Void>  form;
>>                        add(form = new Form<Void>("form"));
>>
>>  form.add(WicketSession.get().getReuseManager().rememberOrReuseAndProvideFeedback(HomePage.class.getSimpleName()
>> + "tf", new TextField<String>("tf", Model.of(""))));
>>        form.add(new Button("doMemorizeInvalidData") {
>>            @Override
>>            public void onSubmit() {
>>                super.onSubmit();
>>                setResponsePage(OtherPage.class);
>>                setRedirect(true);
>>            };
>>        }.setDefaultFormProcessing(false));
>>        form.add(new Button("doUpdateData") {
>>            @Override
>>            public void onSubmit() {
>>                super.onSubmit();
>>                setResponsePage(OtherPage.class);
>>                setRedirect(true);
>>            };
>>        });
>>    }
>> }
>>
>>
>> Reusemanager holder (can be session, can be something else):
>>
>> public class WicketSession extends WebSession {
>>        /**
>>         *
>>         */
>>        private static final long serialVersionUID = 1L;
>>
>>        private final FormComponentReuseManager reuseManager = new
>> FormComponentReuseManager();
>>
>>        public FormComponentReuseManager getReuseManager() {
>>                return reuseManager;
>>        }
>>
>>        /**
>>         * @param request
>>         */
>>        public WicketSession(Request request) {
>>                super(request);
>>        }
>>
>>        /**
>>         * @return WicketSession
>>         */
>>        public static WicketSession get() {
>>                return (WicketSession) Session.get();
>>        }
>> }
>>
>>
>> **
>> Martin
>>
>> 2011/8/12 Mike Mander<[hidden email]>:
>>>
>>> That is not working to. I've created a quickstart for this.
>>> Scenario is simplified. HomePage gets the data and has two submit
>>> buttons.
>>> Do i press the "submit" and click back on other page data are present
>>> (submitted).
>>> Do i press the "invalid submit" and click back on other page data are
>>> lost.
>>>
>>> Here is the code
>>>
>>> DirtyForm.java
>>> <code>
>>> import org.apache.wicket.markup.html.form.Form;
>>> import org.apache.wicket.model.IModel;
>>>
>>> public class DirtyForm<T>  extends Form<T>  {
>>>
>>>    public DirtyForm(String id, IModel<T>  model) {
>>>        super(id, model);
>>>    }
>>>
>>>    public final void submitTheInvalidDataToMySession() {
>>>       //this seems not to be the complete solution
>>>       updateFormComponentModels();
>>>    }
>>> }
>>> </code>
>>>
>>> HomePage.java
>>> <code>
>>>
>>> import org.apache.wicket.PageParameters;
>>> import org.apache.wicket.markup.html.WebPage;
>>> import org.apache.wicket.markup.html.form.Button;
>>> import org.apache.wicket.markup.html.form.TextField;
>>> import org.apache.wicket.model.PropertyModel;
>>>
>>> public class HomePage extends WebPage {
>>>
>>>    public HomePage(final PageParameters parameters) {
>>>
>>>        DirtyForm<String>  form;
>>>        add(form = new DirtyForm<String>("form", new
>>> PropertyModel<String>(new PropertyModel<Object>(this, "session"),
>>> "myBusinessValue"));
>>>        form.add(new TextField<String>("tf", form.getModel()));
>>>        form.add(new Button("doMemorizeInvalidData") {
>>>            @Override
>>>            public void onSubmit() {
>>>                super.onSubmit();
>>>                DirtyForm<?>  f = findParent(DirtyForm.class);
>>>                f.submitTheInvalidDataToMySession();
>>>                setResponsePage(OtherPage.class);
>>>                setRedirect(true);
>>>            };
>>>        }.setDefaultFormProcessing(false));
>>>        form.add(new Button("doUpdateData") {
>>>            @Override
>>>            public void onSubmit() {
>>>                super.onSubmit();
>>>                setResponsePage(OtherPage.class);
>>>                setRedirect(true);
>>>            };
>>>        });
>>>    }
>>> }
>>> </code>
>>>
>>> HomePage.html
>>> <code>
>>> <html
>>>
>>> xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd"
>>> <head>
>>> <title>Wicket Quickstart Archetype Homepage</title>
>>> </head>
>>> <body>
>>> <strong>Wicket Quickstart Archetype Homepage</strong>
>>> <br/><br/>
>>> <div>
>>> <form wicket:id="form">
>>>                Value:
>>> <input type="text" wicket:id="tf" />
>>> <input type="submit" wicket:id="doMemorizeInvalidData" value="invalid
>>> submit" />
>>> <input type="submit" wicket:id="doUpdateData" value="submit" />
>>> </form>
>>> </div>
>>> </body>
>>> </html>
>>> </code>
>>>
>>> MySession.java
>>> <code>
>>> import org.apache.wicket.Request;
>>> import org.apache.wicket.protocol.http.WebSession;
>>>
>>> public class MySession extends WebSession {
>>>
>>>    private String myBusinessValue = null;
>>>
>>>    public MySession(Request request) {
>>>        super(request);
>>>    }
>>>
>>>    public void setMyBusinessValue(String myBusinessValue) {
>>>        this.myBusinessValue = myBusinessValue;
>>>    }
>>>
>>>    public String getMyBusinessValue() {
>>>        return myBusinessValue;
>>>    }
>>> }
>>> </code>
>>>
>>> OtherPage.java
>>> <code>
>>> import org.apache.wicket.markup.html.WebPage;
>>>
>>> public class OtherPage extends WebPage {
>>>
>>>    public OtherPage() {
>>>    }
>>> }
>>> </code>
>>>
>>> OtherPage.html
>>> <code>
>>> <html
>>>
>>> xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd"
>>> <head>
>>> <title>Wicket Quickstart Archetype Homepage</title>
>>> </head>
>>> <body>
>>> <strong>Wicket Quickstart Archetype Homepage</strong>
>>> <br/><br/>
>>> <a href="/">Back</a>
>>> </body>
>>> </html>
>>> </code>
>>>
>>> WicketApplication.java
>>> <code>
>>> import org.apache.wicket.Request;
>>> import org.apache.wicket.Response;
>>> import org.apache.wicket.Session;
>>> import org.apache.wicket.protocol.http.WebApplication;
>>>
>>> public class WicketApplication extends WebApplication {
>>>    @Override
>>>    public Class<HomePage>  getHomePage() {
>>>        return HomePage.class;
>>>    }
>>>
>>>    @Override
>>>    public Session newSession(Request request, Response response) {
>>>        return new MySession(request);
>>>    }
>>> }
>>> </code>
>>>
>>>> In your GoBack button's submit method (dpf = false), call
>>>>
>>>>    form.updateFormComponentModels()
>>>>
>>>>
>>>>
>>>> *Bruno Borges *
>>>> www.brunoborges.com.br
>>>> +55 21 76727099
>>>>
>>>>
>>>>
>>>> On Thu, Aug 11, 2011 at 12:08 PM, Mike Mander<[hidden email]>
>>>>  wrote:
>>>>
>>>>> Am 11.08.2011 16:54, schrieb Bruno Borges:
>>>>>
>>>>>> You want to go back to another page without having to fill the form,
>>>>>> but
>>>>>> you
>>>>>> also don't want to lose data you typed in in the previous screen?
>>>>>> Seems
>>>>>> weird to me.
>>>>>>
>>>>>> Have you considered to add Ajax update behaviour? onBlur of
>>>>>> components,
>>>>>> you
>>>>>> could update the model of each component.
>>>>>> *Bruno Borges*
>>>>>> www.brunoborges.com.br
>>>>>> +55 21 76727099
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Thu, Aug 11, 2011 at 11:50 AM, Mike Mander<[hidden email]>
>>>>>> wrote:
>>>>>>
>>>>>>  Am 11.08.2011 16:36, schrieb Bruno Borges:
>>>>>>>
>>>>>>>  Shouldn't you be submitting that button anyway? dfp = true
>>>>>>>>
>>>>>>>> *Bruno Borges*
>>>>>>>> www.brunoborges.com.br
>>>>>>>> +55 21 76727099
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> On Thu, Aug 11, 2011 at 10:44 AM, Mike Mander<[hidden email]>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>  Hi,
>>>>>>>>
>>>>>>>>> i've added a domain model globally to my session.
>>>>>>>>>
>>>>>>>>> A form for editing this data is provided on page A. On this i have
>>>>>>>>> 2
>>>>>>>>> submit
>>>>>>>>> buttons. One with setDefaultFormProcessing false (to previous page)
>>>>>>>>> and
>>>>>>>>> one
>>>>>>>>> with true (to next step).
>>>>>>>>>
>>>>>>>>> If i press the main submit (next step | dfp = true) then everything
>>>>>>>>> works
>>>>>>>>> as expected. If i press the other (previous page |dfp = false) and
>>>>>>>>> redirect
>>>>>>>>> to Page A all data are lost. I'm absolutely aware of the issue that
>>>>>>>>> false
>>>>>>>>> in
>>>>>>>>> defaultFormProcessing is not submitting the data.
>>>>>>>>>
>>>>>>>>> But because i cannot reproduce the input changed part of the form
>>>>>>>>> processing, i can't submit the invalid data manually. Is there any
>>>>>>>>> way
>>>>>>>>> to
>>>>>>>>> achieve my goal?
>>>>>>>>>
>>>>>>>>> Thanks
>>>>>>>>> Mike
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> ------------------------------******--------------------------**--**
>>>>>>>>> --**---------
>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.****apa**che.org<
>>>>>>>>> http://apache.org**>
>>>>>>>>> <users-unsubscribe@**wicket.**apache.org<http://wicket.apache.org><
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> users-unsubscribe@**wicket.apache.org<[hidden email]>
>>>>>>>>> For additional commands, e-mail: [hidden email]
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>  Then i can't goback to previous page without filling the form.
>>>>>>>>>
>>>>>>>> The scenario is
>>>>>>>
>>>>>>> 1. goto basket
>>>>>>> 2. goto checkout (Page A in post) enter some data
>>>>>>> 3. goback to basket (dfp = false) validation should be bypassed
>>>>>>> 4. goto checkout =>     all entered data are present
>>>>>>>
>>>>>>> But until now with this scenario i lost all data in step 4
>>>>>>>
>>>>>>> Thanks
>>>>>>> Mike
>>>>>>>
>>>>>>> PS: I use buttons to stay in javascript-less mode :-)
>>>>>>>
>>>>>>>
>>>>>>> ------------------------------****----------------------------**
>>>>>>> --**---------
>>>>>>> To unsubscribe, e-mail:
>>>>>>> users-unsubscribe@wicket.**apa**che.org<http://apache.org>
>>>>>>>
>>>>>>>
>>>>>>> <users-unsubscribe@**wicket.apache.org<[hidden email]>
>>>>>>> For additional commands, e-mail: [hidden email]
>>>>>>>
>>>>>>>
>>>>>>>  Ajax is not an option - i have to stay javascript-less.
>>>>>
>>>>>   You want to go back to another page without having to fill the form,
>>>>> but
>>>>>>
>>>>>> you
>>>>>>  also don't want to lose data you typed in in the previous screen?
>>>>>> Seems
>>>>>>  weird to me.
>>>>>>
>>>>> Not the previous screen. The current screen.
>>>>>
>>>>> I come from basket. I goto checkout. I start typing. I think oops what
>>>>> was
>>>>> the option in basket
>>>>> and goback to basket (dfp = false). I check the basket option and think
>>>>> ok
>>>>> let's go on checkout.
>>>>> And on checkout i think - damn all typed data have gone. So i leave the
>>>>> shop.
>>>>>
>>>>> That's the scenario i try to catch.
>>>>>
>>>>>
>>>>> Thanks
>>>>> Mike
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> ------------------------------**------------------------------**---------
>>>>> To unsubscribe, e-mail:
>>>>>
>>>>> users-unsubscribe@wicket.**apache.org<[hidden email]>
>>>>> For additional commands, e-mail: [hidden email]
>>>>>
>>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Form looses data

Martin Makundi
AH.... not to say that I would mind if wicket would handle
reusemanager itself.. I wonder if it is there in 1.5? Hmm.. I think a
proposal should be added to the whishlist.

**
Martin

2011/8/12 Martin Makundi <[hidden email]>:

> The Form way is a quirk way to do it in the first place. You are not
> supposed to update model before validation etc. so you will run into
> lots of troubles that way.
>
> Reusemanager simply works like wicket normally works when you validate
> and repaint the screen with rawInput values. It just keeps those
> components and copies the old rawInput value which was persisted
> during incomplete submit.
>
> **
> Martin
>
> 2011/8/12 Mike Mander <[hidden email]>:
>> Thanks Martin,
>>
>> now it works as expected. I don't have a clue how but it is.
>> I really would be interested in knowing why the reusemanager gets the data
>> and the form not.
>>
>> I think i will start a debugging session at weekend :-)
>>
>> Maybe we should use this scenario and put it in the wiki? Especially in shop
>> environments it's
>> a big frustration point if form values is lost only because i want to see
>> what i typed in last page.
>> And ask the user to provide all data until validation passes is decreasing
>> the conversion rate :-(
>> So maybe others will benefit from the found / working solution to.
>>
>> Thanks again
>> Mike
>>
>>> This is how you can do it with reusemanager:
>>>
>>>
>>> HomePage:
>>> public class HomePage extends WebPage {
>>>        public HomePage(final PageParameters parameters) {
>>>        Form<Void>  form;
>>>                        add(form = new Form<Void>("form"));
>>>
>>>  form.add(WicketSession.get().getReuseManager().rememberOrReuseAndProvideFeedback(HomePage.class.getSimpleName()
>>> + "tf", new TextField<String>("tf", Model.of(""))));
>>>        form.add(new Button("doMemorizeInvalidData") {
>>>            @Override
>>>            public void onSubmit() {
>>>                super.onSubmit();
>>>                setResponsePage(OtherPage.class);
>>>                setRedirect(true);
>>>            };
>>>        }.setDefaultFormProcessing(false));
>>>        form.add(new Button("doUpdateData") {
>>>            @Override
>>>            public void onSubmit() {
>>>                super.onSubmit();
>>>                setResponsePage(OtherPage.class);
>>>                setRedirect(true);
>>>            };
>>>        });
>>>    }
>>> }
>>>
>>>
>>> Reusemanager holder (can be session, can be something else):
>>>
>>> public class WicketSession extends WebSession {
>>>        /**
>>>         *
>>>         */
>>>        private static final long serialVersionUID = 1L;
>>>
>>>        private final FormComponentReuseManager reuseManager = new
>>> FormComponentReuseManager();
>>>
>>>        public FormComponentReuseManager getReuseManager() {
>>>                return reuseManager;
>>>        }
>>>
>>>        /**
>>>         * @param request
>>>         */
>>>        public WicketSession(Request request) {
>>>                super(request);
>>>        }
>>>
>>>        /**
>>>         * @return WicketSession
>>>         */
>>>        public static WicketSession get() {
>>>                return (WicketSession) Session.get();
>>>        }
>>> }
>>>
>>>
>>> **
>>> Martin
>>>
>>> 2011/8/12 Mike Mander<[hidden email]>:
>>>>
>>>> That is not working to. I've created a quickstart for this.
>>>> Scenario is simplified. HomePage gets the data and has two submit
>>>> buttons.
>>>> Do i press the "submit" and click back on other page data are present
>>>> (submitted).
>>>> Do i press the "invalid submit" and click back on other page data are
>>>> lost.
>>>>
>>>> Here is the code
>>>>
>>>> DirtyForm.java
>>>> <code>
>>>> import org.apache.wicket.markup.html.form.Form;
>>>> import org.apache.wicket.model.IModel;
>>>>
>>>> public class DirtyForm<T>  extends Form<T>  {
>>>>
>>>>    public DirtyForm(String id, IModel<T>  model) {
>>>>        super(id, model);
>>>>    }
>>>>
>>>>    public final void submitTheInvalidDataToMySession() {
>>>>       //this seems not to be the complete solution
>>>>       updateFormComponentModels();
>>>>    }
>>>> }
>>>> </code>
>>>>
>>>> HomePage.java
>>>> <code>
>>>>
>>>> import org.apache.wicket.PageParameters;
>>>> import org.apache.wicket.markup.html.WebPage;
>>>> import org.apache.wicket.markup.html.form.Button;
>>>> import org.apache.wicket.markup.html.form.TextField;
>>>> import org.apache.wicket.model.PropertyModel;
>>>>
>>>> public class HomePage extends WebPage {
>>>>
>>>>    public HomePage(final PageParameters parameters) {
>>>>
>>>>        DirtyForm<String>  form;
>>>>        add(form = new DirtyForm<String>("form", new
>>>> PropertyModel<String>(new PropertyModel<Object>(this, "session"),
>>>> "myBusinessValue"));
>>>>        form.add(new TextField<String>("tf", form.getModel()));
>>>>        form.add(new Button("doMemorizeInvalidData") {
>>>>            @Override
>>>>            public void onSubmit() {
>>>>                super.onSubmit();
>>>>                DirtyForm<?>  f = findParent(DirtyForm.class);
>>>>                f.submitTheInvalidDataToMySession();
>>>>                setResponsePage(OtherPage.class);
>>>>                setRedirect(true);
>>>>            };
>>>>        }.setDefaultFormProcessing(false));
>>>>        form.add(new Button("doUpdateData") {
>>>>            @Override
>>>>            public void onSubmit() {
>>>>                super.onSubmit();
>>>>                setResponsePage(OtherPage.class);
>>>>                setRedirect(true);
>>>>            };
>>>>        });
>>>>    }
>>>> }
>>>> </code>
>>>>
>>>> HomePage.html
>>>> <code>
>>>> <html
>>>>
>>>> xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd"
>>>> <head>
>>>> <title>Wicket Quickstart Archetype Homepage</title>
>>>> </head>
>>>> <body>
>>>> <strong>Wicket Quickstart Archetype Homepage</strong>
>>>> <br/><br/>
>>>> <div>
>>>> <form wicket:id="form">
>>>>                Value:
>>>> <input type="text" wicket:id="tf" />
>>>> <input type="submit" wicket:id="doMemorizeInvalidData" value="invalid
>>>> submit" />
>>>> <input type="submit" wicket:id="doUpdateData" value="submit" />
>>>> </form>
>>>> </div>
>>>> </body>
>>>> </html>
>>>> </code>
>>>>
>>>> MySession.java
>>>> <code>
>>>> import org.apache.wicket.Request;
>>>> import org.apache.wicket.protocol.http.WebSession;
>>>>
>>>> public class MySession extends WebSession {
>>>>
>>>>    private String myBusinessValue = null;
>>>>
>>>>    public MySession(Request request) {
>>>>        super(request);
>>>>    }
>>>>
>>>>    public void setMyBusinessValue(String myBusinessValue) {
>>>>        this.myBusinessValue = myBusinessValue;
>>>>    }
>>>>
>>>>    public String getMyBusinessValue() {
>>>>        return myBusinessValue;
>>>>    }
>>>> }
>>>> </code>
>>>>
>>>> OtherPage.java
>>>> <code>
>>>> import org.apache.wicket.markup.html.WebPage;
>>>>
>>>> public class OtherPage extends WebPage {
>>>>
>>>>    public OtherPage() {
>>>>    }
>>>> }
>>>> </code>
>>>>
>>>> OtherPage.html
>>>> <code>
>>>> <html
>>>>
>>>> xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd"
>>>> <head>
>>>> <title>Wicket Quickstart Archetype Homepage</title>
>>>> </head>
>>>> <body>
>>>> <strong>Wicket Quickstart Archetype Homepage</strong>
>>>> <br/><br/>
>>>> <a href="/">Back</a>
>>>> </body>
>>>> </html>
>>>> </code>
>>>>
>>>> WicketApplication.java
>>>> <code>
>>>> import org.apache.wicket.Request;
>>>> import org.apache.wicket.Response;
>>>> import org.apache.wicket.Session;
>>>> import org.apache.wicket.protocol.http.WebApplication;
>>>>
>>>> public class WicketApplication extends WebApplication {
>>>>    @Override
>>>>    public Class<HomePage>  getHomePage() {
>>>>        return HomePage.class;
>>>>    }
>>>>
>>>>    @Override
>>>>    public Session newSession(Request request, Response response) {
>>>>        return new MySession(request);
>>>>    }
>>>> }
>>>> </code>
>>>>
>>>>> In your GoBack button's submit method (dpf = false), call
>>>>>
>>>>>    form.updateFormComponentModels()
>>>>>
>>>>>
>>>>>
>>>>> *Bruno Borges *
>>>>> www.brunoborges.com.br
>>>>> +55 21 76727099
>>>>>
>>>>>
>>>>>
>>>>> On Thu, Aug 11, 2011 at 12:08 PM, Mike Mander<[hidden email]>
>>>>>  wrote:
>>>>>
>>>>>> Am 11.08.2011 16:54, schrieb Bruno Borges:
>>>>>>
>>>>>>> You want to go back to another page without having to fill the form,
>>>>>>> but
>>>>>>> you
>>>>>>> also don't want to lose data you typed in in the previous screen?
>>>>>>> Seems
>>>>>>> weird to me.
>>>>>>>
>>>>>>> Have you considered to add Ajax update behaviour? onBlur of
>>>>>>> components,
>>>>>>> you
>>>>>>> could update the model of each component.
>>>>>>> *Bruno Borges*
>>>>>>> www.brunoborges.com.br
>>>>>>> +55 21 76727099
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Thu, Aug 11, 2011 at 11:50 AM, Mike Mander<[hidden email]>
>>>>>>> wrote:
>>>>>>>
>>>>>>>  Am 11.08.2011 16:36, schrieb Bruno Borges:
>>>>>>>>
>>>>>>>>  Shouldn't you be submitting that button anyway? dfp = true
>>>>>>>>>
>>>>>>>>> *Bruno Borges*
>>>>>>>>> www.brunoborges.com.br
>>>>>>>>> +55 21 76727099
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Thu, Aug 11, 2011 at 10:44 AM, Mike Mander<[hidden email]>
>>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>>  Hi,
>>>>>>>>>
>>>>>>>>>> i've added a domain model globally to my session.
>>>>>>>>>>
>>>>>>>>>> A form for editing this data is provided on page A. On this i have
>>>>>>>>>> 2
>>>>>>>>>> submit
>>>>>>>>>> buttons. One with setDefaultFormProcessing false (to previous page)
>>>>>>>>>> and
>>>>>>>>>> one
>>>>>>>>>> with true (to next step).
>>>>>>>>>>
>>>>>>>>>> If i press the main submit (next step | dfp = true) then everything
>>>>>>>>>> works
>>>>>>>>>> as expected. If i press the other (previous page |dfp = false) and
>>>>>>>>>> redirect
>>>>>>>>>> to Page A all data are lost. I'm absolutely aware of the issue that
>>>>>>>>>> false
>>>>>>>>>> in
>>>>>>>>>> defaultFormProcessing is not submitting the data.
>>>>>>>>>>
>>>>>>>>>> But because i cannot reproduce the input changed part of the form
>>>>>>>>>> processing, i can't submit the invalid data manually. Is there any
>>>>>>>>>> way
>>>>>>>>>> to
>>>>>>>>>> achieve my goal?
>>>>>>>>>>
>>>>>>>>>> Thanks
>>>>>>>>>> Mike
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> ------------------------------******--------------------------**--**
>>>>>>>>>> --**---------
>>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.****apa**che.org<
>>>>>>>>>> http://apache.org**>
>>>>>>>>>> <users-unsubscribe@**wicket.**apache.org<http://wicket.apache.org><
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> users-unsubscribe@**wicket.apache.org<[hidden email]>
>>>>>>>>>> For additional commands, e-mail: [hidden email]
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>  Then i can't goback to previous page without filling the form.
>>>>>>>>>>
>>>>>>>>> The scenario is
>>>>>>>>
>>>>>>>> 1. goto basket
>>>>>>>> 2. goto checkout (Page A in post) enter some data
>>>>>>>> 3. goback to basket (dfp = false) validation should be bypassed
>>>>>>>> 4. goto checkout =>     all entered data are present
>>>>>>>>
>>>>>>>> But until now with this scenario i lost all data in step 4
>>>>>>>>
>>>>>>>> Thanks
>>>>>>>> Mike
>>>>>>>>
>>>>>>>> PS: I use buttons to stay in javascript-less mode :-)
>>>>>>>>
>>>>>>>>
>>>>>>>> ------------------------------****----------------------------**
>>>>>>>> --**---------
>>>>>>>> To unsubscribe, e-mail:
>>>>>>>> users-unsubscribe@wicket.**apa**che.org<http://apache.org>
>>>>>>>>
>>>>>>>>
>>>>>>>> <users-unsubscribe@**wicket.apache.org<[hidden email]>
>>>>>>>> For additional commands, e-mail: [hidden email]
>>>>>>>>
>>>>>>>>
>>>>>>>>  Ajax is not an option - i have to stay javascript-less.
>>>>>>
>>>>>>   You want to go back to another page without having to fill the form,
>>>>>> but
>>>>>>>
>>>>>>> you
>>>>>>>  also don't want to lose data you typed in in the previous screen?
>>>>>>> Seems
>>>>>>>  weird to me.
>>>>>>>
>>>>>> Not the previous screen. The current screen.
>>>>>>
>>>>>> I come from basket. I goto checkout. I start typing. I think oops what
>>>>>> was
>>>>>> the option in basket
>>>>>> and goback to basket (dfp = false). I check the basket option and think
>>>>>> ok
>>>>>> let's go on checkout.
>>>>>> And on checkout i think - damn all typed data have gone. So i leave the
>>>>>> shop.
>>>>>>
>>>>>> That's the scenario i try to catch.
>>>>>>
>>>>>>
>>>>>> Thanks
>>>>>> Mike
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> ------------------------------**------------------------------**---------
>>>>>> To unsubscribe, e-mail:
>>>>>>
>>>>>> users-unsubscribe@wicket.**apache.org<[hidden email]>
>>>>>> For additional commands, e-mail: [hidden email]
>>>>>>
>>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [hidden email]
>>>> For additional commands, e-mail: [hidden email]
>>>>
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Form looses data

Mike Mander
But if wicket should support it out of the box there is maybe another way.
If we could get a method onBeforeFormSubmit() in form there would be
an access point to configure validators in all childs.
In default nothing is to do - means leave form as configured at creation
time.
If it's nessecary i could set a flag or something to validate components
conditional.

Form.java
...

protected void onBeforeFormSubmit() {
   if (findSubmittingButton.getId().equals("mySpecialButton")) {
     setGlobalFlag(true);
   } else {
     setGlobalFlag(false);
   }
}

and in Validator
MyValidator.java
void validate(IValidatable<T> validatable) {
   if (!getGlobalFlag()) {
     doValidation();
   }
}

That would make it possibly unnessecary to store the component
references in session.
Or are there other usecases i don't see for ReuseManager.

> AH.... not to say that I would mind if wicket would handle
> reusemanager itself.. I wonder if it is there in 1.5? Hmm.. I think a
> proposal should be added to the whishlist.
>
> **
> Martin
>
> 2011/8/12 Martin Makundi<[hidden email]>:
>> The Form way is a quirk way to do it in the first place. You are not
>> supposed to update model before validation etc. so you will run into
>> lots of troubles that way.
>>
>> Reusemanager simply works like wicket normally works when you validate
>> and repaint the screen with rawInput values. It just keeps those
>> components and copies the old rawInput value which was persisted
>> during incomplete submit.
>>
>> **
>> Martin
>>
>> 2011/8/12 Mike Mander<[hidden email]>:
>>> Thanks Martin,
>>>
>>> now it works as expected. I don't have a clue how but it is.
>>> I really would be interested in knowing why the reusemanager gets the data
>>> and the form not.
>>>
>>> I think i will start a debugging session at weekend :-)
>>>
>>> Maybe we should use this scenario and put it in the wiki? Especially in shop
>>> environments it's
>>> a big frustration point if form values is lost only because i want to see
>>> what i typed in last page.
>>> And ask the user to provide all data until validation passes is decreasing
>>> the conversion rate :-(
>>> So maybe others will benefit from the found / working solution to.
>>>
>>> Thanks again
>>> Mike
>>>
>>>> This is how you can do it with reusemanager:
>>>>
>>>>
>>>> HomePage:
>>>> public class HomePage extends WebPage {
>>>>         public HomePage(final PageParameters parameters) {
>>>>         Form<Void>    form;
>>>>                         add(form = new Form<Void>("form"));
>>>>
>>>>   form.add(WicketSession.get().getReuseManager().rememberOrReuseAndProvideFeedback(HomePage.class.getSimpleName()
>>>> + "tf", new TextField<String>("tf", Model.of(""))));
>>>>         form.add(new Button("doMemorizeInvalidData") {
>>>>             @Override
>>>>             public void onSubmit() {
>>>>                 super.onSubmit();
>>>>                 setResponsePage(OtherPage.class);
>>>>                 setRedirect(true);
>>>>             };
>>>>         }.setDefaultFormProcessing(false));
>>>>         form.add(new Button("doUpdateData") {
>>>>             @Override
>>>>             public void onSubmit() {
>>>>                 super.onSubmit();
>>>>                 setResponsePage(OtherPage.class);
>>>>                 setRedirect(true);
>>>>             };
>>>>         });
>>>>     }
>>>> }
>>>>
>>>>
>>>> Reusemanager holder (can be session, can be something else):
>>>>
>>>> public class WicketSession extends WebSession {
>>>>         /**
>>>>          *
>>>>          */
>>>>         private static final long serialVersionUID = 1L;
>>>>
>>>>         private final FormComponentReuseManager reuseManager = new
>>>> FormComponentReuseManager();
>>>>
>>>>         public FormComponentReuseManager getReuseManager() {
>>>>                 return reuseManager;
>>>>         }
>>>>
>>>>         /**
>>>>          * @param request
>>>>          */
>>>>         public WicketSession(Request request) {
>>>>                 super(request);
>>>>         }
>>>>
>>>>         /**
>>>>          * @return WicketSession
>>>>          */
>>>>         public static WicketSession get() {
>>>>                 return (WicketSession) Session.get();
>>>>         }
>>>> }
>>>>
>>>>
>>>> **
>>>> Martin
>>>>
>>>> 2011/8/12 Mike Mander<[hidden email]>:
>>>>> That is not working to. I've created a quickstart for this.
>>>>> Scenario is simplified. HomePage gets the data and has two submit
>>>>> buttons.
>>>>> Do i press the "submit" and click back on other page data are present
>>>>> (submitted).
>>>>> Do i press the "invalid submit" and click back on other page data are
>>>>> lost.
>>>>>
>>>>> Here is the code
>>>>>
>>>>> DirtyForm.java
>>>>> <code>
>>>>> import org.apache.wicket.markup.html.form.Form;
>>>>> import org.apache.wicket.model.IModel;
>>>>>
>>>>> public class DirtyForm<T>    extends Form<T>    {
>>>>>
>>>>>     public DirtyForm(String id, IModel<T>    model) {
>>>>>         super(id, model);
>>>>>     }
>>>>>
>>>>>     public final void submitTheInvalidDataToMySession() {
>>>>>        //this seems not to be the complete solution
>>>>>        updateFormComponentModels();
>>>>>     }
>>>>> }
>>>>> </code>
>>>>>
>>>>> HomePage.java
>>>>> <code>
>>>>>
>>>>> import org.apache.wicket.PageParameters;
>>>>> import org.apache.wicket.markup.html.WebPage;
>>>>> import org.apache.wicket.markup.html.form.Button;
>>>>> import org.apache.wicket.markup.html.form.TextField;
>>>>> import org.apache.wicket.model.PropertyModel;
>>>>>
>>>>> public class HomePage extends WebPage {
>>>>>
>>>>>     public HomePage(final PageParameters parameters) {
>>>>>
>>>>>         DirtyForm<String>    form;
>>>>>         add(form = new DirtyForm<String>("form", new
>>>>> PropertyModel<String>(new PropertyModel<Object>(this, "session"),
>>>>> "myBusinessValue"));
>>>>>         form.add(new TextField<String>("tf", form.getModel()));
>>>>>         form.add(new Button("doMemorizeInvalidData") {
>>>>>             @Override
>>>>>             public void onSubmit() {
>>>>>                 super.onSubmit();
>>>>>                 DirtyForm<?>    f = findParent(DirtyForm.class);
>>>>>                 f.submitTheInvalidDataToMySession();
>>>>>                 setResponsePage(OtherPage.class);
>>>>>                 setRedirect(true);
>>>>>             };
>>>>>         }.setDefaultFormProcessing(false));
>>>>>         form.add(new Button("doUpdateData") {
>>>>>             @Override
>>>>>             public void onSubmit() {
>>>>>                 super.onSubmit();
>>>>>                 setResponsePage(OtherPage.class);
>>>>>                 setRedirect(true);
>>>>>             };
>>>>>         });
>>>>>     }
>>>>> }
>>>>> </code>
>>>>>
>>>>> HomePage.html
>>>>> <code>
>>>>> <html
>>>>>
>>>>> xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd"
>>>>> <head>
>>>>> <title>Wicket Quickstart Archetype Homepage</title>
>>>>> </head>
>>>>> <body>
>>>>> <strong>Wicket Quickstart Archetype Homepage</strong>
>>>>> <br/><br/>
>>>>> <div>
>>>>> <form wicket:id="form">
>>>>>                 Value:
>>>>> <input type="text" wicket:id="tf" />
>>>>> <input type="submit" wicket:id="doMemorizeInvalidData" value="invalid
>>>>> submit" />
>>>>> <input type="submit" wicket:id="doUpdateData" value="submit" />
>>>>> </form>
>>>>> </div>
>>>>> </body>
>>>>> </html>
>>>>> </code>
>>>>>
>>>>> MySession.java
>>>>> <code>
>>>>> import org.apache.wicket.Request;
>>>>> import org.apache.wicket.protocol.http.WebSession;
>>>>>
>>>>> public class MySession extends WebSession {
>>>>>
>>>>>     private String myBusinessValue = null;
>>>>>
>>>>>     public MySession(Request request) {
>>>>>         super(request);
>>>>>     }
>>>>>
>>>>>     public void setMyBusinessValue(String myBusinessValue) {
>>>>>         this.myBusinessValue = myBusinessValue;
>>>>>     }
>>>>>
>>>>>     public String getMyBusinessValue() {
>>>>>         return myBusinessValue;
>>>>>     }
>>>>> }
>>>>> </code>
>>>>>
>>>>> OtherPage.java
>>>>> <code>
>>>>> import org.apache.wicket.markup.html.WebPage;
>>>>>
>>>>> public class OtherPage extends WebPage {
>>>>>
>>>>>     public OtherPage() {
>>>>>     }
>>>>> }
>>>>> </code>
>>>>>
>>>>> OtherPage.html
>>>>> <code>
>>>>> <html
>>>>>
>>>>> xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd"
>>>>> <head>
>>>>> <title>Wicket Quickstart Archetype Homepage</title>
>>>>> </head>
>>>>> <body>
>>>>> <strong>Wicket Quickstart Archetype Homepage</strong>
>>>>> <br/><br/>
>>>>> <a href="/">Back</a>
>>>>> </body>
>>>>> </html>
>>>>> </code>
>>>>>
>>>>> WicketApplication.java
>>>>> <code>
>>>>> import org.apache.wicket.Request;
>>>>> import org.apache.wicket.Response;
>>>>> import org.apache.wicket.Session;
>>>>> import org.apache.wicket.protocol.http.WebApplication;
>>>>>
>>>>> public class WicketApplication extends WebApplication {
>>>>>     @Override
>>>>>     public Class<HomePage>    getHomePage() {
>>>>>         return HomePage.class;
>>>>>     }
>>>>>
>>>>>     @Override
>>>>>     public Session newSession(Request request, Response response) {
>>>>>         return new MySession(request);
>>>>>     }
>>>>> }
>>>>> </code>
>>>>>
>>>>>> In your GoBack button's submit method (dpf = false), call
>>>>>>
>>>>>>     form.updateFormComponentModels()
>>>>>>
>>>>>>
>>>>>>
>>>>>> *Bruno Borges *
>>>>>> www.brunoborges.com.br
>>>>>> +55 21 76727099
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Thu, Aug 11, 2011 at 12:08 PM, Mike Mander<[hidden email]>
>>>>>>   wrote:
>>>>>>
>>>>>>> Am 11.08.2011 16:54, schrieb Bruno Borges:
>>>>>>>
>>>>>>>> You want to go back to another page without having to fill the form,
>>>>>>>> but
>>>>>>>> you
>>>>>>>> also don't want to lose data you typed in in the previous screen?
>>>>>>>> Seems
>>>>>>>> weird to me.
>>>>>>>>
>>>>>>>> Have you considered to add Ajax update behaviour? onBlur of
>>>>>>>> components,
>>>>>>>> you
>>>>>>>> could update the model of each component.
>>>>>>>> *Bruno Borges*
>>>>>>>> www.brunoborges.com.br
>>>>>>>> +55 21 76727099
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> On Thu, Aug 11, 2011 at 11:50 AM, Mike Mander<[hidden email]>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>   Am 11.08.2011 16:36, schrieb Bruno Borges:
>>>>>>>>>   Shouldn't you be submitting that button anyway? dfp = true
>>>>>>>>>> *Bruno Borges*
>>>>>>>>>> www.brunoborges.com.br
>>>>>>>>>> +55 21 76727099
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Thu, Aug 11, 2011 at 10:44 AM, Mike Mander<[hidden email]>
>>>>>>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>>   Hi,
>>>>>>>>>>
>>>>>>>>>>> i've added a domain model globally to my session.
>>>>>>>>>>>
>>>>>>>>>>> A form for editing this data is provided on page A. On this i have
>>>>>>>>>>> 2
>>>>>>>>>>> submit
>>>>>>>>>>> buttons. One with setDefaultFormProcessing false (to previous page)
>>>>>>>>>>> and
>>>>>>>>>>> one
>>>>>>>>>>> with true (to next step).
>>>>>>>>>>>
>>>>>>>>>>> If i press the main submit (next step | dfp = true) then everything
>>>>>>>>>>> works
>>>>>>>>>>> as expected. If i press the other (previous page |dfp = false) and
>>>>>>>>>>> redirect
>>>>>>>>>>> to Page A all data are lost. I'm absolutely aware of the issue that
>>>>>>>>>>> false
>>>>>>>>>>> in
>>>>>>>>>>> defaultFormProcessing is not submitting the data.
>>>>>>>>>>>
>>>>>>>>>>> But because i cannot reproduce the input changed part of the form
>>>>>>>>>>> processing, i can't submit the invalid data manually. Is there any
>>>>>>>>>>> way
>>>>>>>>>>> to
>>>>>>>>>>> achieve my goal?
>>>>>>>>>>>
>>>>>>>>>>> Thanks
>>>>>>>>>>> Mike
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> ------------------------------******--------------------------**--**
>>>>>>>>>>> --**---------
>>>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.****apa**che.org<
>>>>>>>>>>> http://apache.org**>
>>>>>>>>>>> <users-unsubscribe@**wicket.**apache.org<http://wicket.apache.org><
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> users-unsubscribe@**wicket.apache.org<[hidden email]>
>>>>>>>>>>> For additional commands, e-mail: [hidden email]
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>   Then i can't goback to previous page without filling the form.
>>>>>>>>>>>
>>>>>>>>>> The scenario is
>>>>>>>>> 1. goto basket
>>>>>>>>> 2. goto checkout (Page A in post) enter some data
>>>>>>>>> 3. goback to basket (dfp = false) validation should be bypassed
>>>>>>>>> 4. goto checkout =>       all entered data are present
>>>>>>>>>
>>>>>>>>> But until now with this scenario i lost all data in step 4
>>>>>>>>>
>>>>>>>>> Thanks
>>>>>>>>> Mike
>>>>>>>>>
>>>>>>>>> PS: I use buttons to stay in javascript-less mode :-)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> ------------------------------****----------------------------**
>>>>>>>>> --**---------
>>>>>>>>> To unsubscribe, e-mail:
>>>>>>>>> users-unsubscribe@wicket.**apa**che.org<http://apache.org>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> <users-unsubscribe@**wicket.apache.org<[hidden email]>
>>>>>>>>> For additional commands, e-mail: [hidden email]
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>   Ajax is not an option - i have to stay javascript-less.
>>>>>>>    You want to go back to another page without having to fill the form,
>>>>>>> but
>>>>>>>> you
>>>>>>>>   also don't want to lose data you typed in in the previous screen?
>>>>>>>> Seems
>>>>>>>>   weird to me.
>>>>>>>>
>>>>>>> Not the previous screen. The current screen.
>>>>>>>
>>>>>>> I come from basket. I goto checkout. I start typing. I think oops what
>>>>>>> was
>>>>>>> the option in basket
>>>>>>> and goback to basket (dfp = false). I check the basket option and think
>>>>>>> ok
>>>>>>> let's go on checkout.
>>>>>>> And on checkout i think - damn all typed data have gone. So i leave the
>>>>>>> shop.
>>>>>>>
>>>>>>> That's the scenario i try to catch.
>>>>>>>
>>>>>>>
>>>>>>> Thanks
>>>>>>> Mike
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> ------------------------------**------------------------------**---------
>>>>>>> To unsubscribe, e-mail:
>>>>>>>
>>>>>>> users-unsubscribe@wicket.**apache.org<[hidden email]>
>>>>>>> For additional commands, e-mail: [hidden email]
>>>>>>>
>>>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: [hidden email]
>>>>> For additional commands, e-mail: [hidden email]
>>>>>
>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [hidden email]
>>>> For additional commands, e-mail: [hidden email]
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>>
>>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Form looses data

Mike Mander
I checked Form. There is an onValidate. Maybe i can clear the feedback
messages there.
Will try it.

> But if wicket should support it out of the box there is maybe another
> way.
> If we could get a method onBeforeFormSubmit() in form there would be
> an access point to configure validators in all childs.
> In default nothing is to do - means leave form as configured at
> creation time.
> If it's nessecary i could set a flag or something to validate
> components conditional.
>
> Form.java
> ...
>
> protected void onBeforeFormSubmit() {
>   if (findSubmittingButton.getId().equals("mySpecialButton")) {
>     setGlobalFlag(true);
>   } else {
>     setGlobalFlag(false);
>   }
> }
>
> and in Validator
> MyValidator.java
> void validate(IValidatable<T> validatable) {
>   if (!getGlobalFlag()) {
>     doValidation();
>   }
> }
>
> That would make it possibly unnessecary to store the component
> references in session.
> Or are there other usecases i don't see for ReuseManager.
>
>> AH.... not to say that I would mind if wicket would handle
>> reusemanager itself.. I wonder if it is there in 1.5? Hmm.. I think a
>> proposal should be added to the whishlist.
>>
>> **
>> Martin
>>
>> 2011/8/12 Martin Makundi<[hidden email]>:
>>> The Form way is a quirk way to do it in the first place. You are not
>>> supposed to update model before validation etc. so you will run into
>>> lots of troubles that way.
>>>
>>> Reusemanager simply works like wicket normally works when you validate
>>> and repaint the screen with rawInput values. It just keeps those
>>> components and copies the old rawInput value which was persisted
>>> during incomplete submit.
>>>
>>> **
>>> Martin
>>>
>>> 2011/8/12 Mike Mander<[hidden email]>:
>>>> Thanks Martin,
>>>>
>>>> now it works as expected. I don't have a clue how but it is.
>>>> I really would be interested in knowing why the reusemanager gets
>>>> the data
>>>> and the form not.
>>>>
>>>> I think i will start a debugging session at weekend :-)
>>>>
>>>> Maybe we should use this scenario and put it in the wiki?
>>>> Especially in shop
>>>> environments it's
>>>> a big frustration point if form values is lost only because i want
>>>> to see
>>>> what i typed in last page.
>>>> And ask the user to provide all data until validation passes is
>>>> decreasing
>>>> the conversion rate :-(
>>>> So maybe others will benefit from the found / working solution to.
>>>>
>>>> Thanks again
>>>> Mike
>>>>
>>>>> This is how you can do it with reusemanager:
>>>>>
>>>>>
>>>>> HomePage:
>>>>> public class HomePage extends WebPage {
>>>>>         public HomePage(final PageParameters parameters) {
>>>>>         Form<Void>    form;
>>>>>                         add(form = new Form<Void>("form"));
>>>>>
>>>>>  
>>>>> form.add(WicketSession.get().getReuseManager().rememberOrReuseAndProvideFeedback(HomePage.class.getSimpleName()
>>>>> + "tf", new TextField<String>("tf", Model.of(""))));
>>>>>         form.add(new Button("doMemorizeInvalidData") {
>>>>>             @Override
>>>>>             public void onSubmit() {
>>>>>                 super.onSubmit();
>>>>>                 setResponsePage(OtherPage.class);
>>>>>                 setRedirect(true);
>>>>>             };
>>>>>         }.setDefaultFormProcessing(false));
>>>>>         form.add(new Button("doUpdateData") {
>>>>>             @Override
>>>>>             public void onSubmit() {
>>>>>                 super.onSubmit();
>>>>>                 setResponsePage(OtherPage.class);
>>>>>                 setRedirect(true);
>>>>>             };
>>>>>         });
>>>>>     }
>>>>> }
>>>>>
>>>>>
>>>>> Reusemanager holder (can be session, can be something else):
>>>>>
>>>>> public class WicketSession extends WebSession {
>>>>>         /**
>>>>>          *
>>>>>          */
>>>>>         private static final long serialVersionUID = 1L;
>>>>>
>>>>>         private final FormComponentReuseManager reuseManager = new
>>>>> FormComponentReuseManager();
>>>>>
>>>>>         public FormComponentReuseManager getReuseManager() {
>>>>>                 return reuseManager;
>>>>>         }
>>>>>
>>>>>         /**
>>>>>          * @param request
>>>>>          */
>>>>>         public WicketSession(Request request) {
>>>>>                 super(request);
>>>>>         }
>>>>>
>>>>>         /**
>>>>>          * @return WicketSession
>>>>>          */
>>>>>         public static WicketSession get() {
>>>>>                 return (WicketSession) Session.get();
>>>>>         }
>>>>> }
>>>>>
>>>>>
>>>>> **
>>>>> Martin
>>>>>
>>>>> 2011/8/12 Mike Mander<[hidden email]>:
>>>>>> That is not working to. I've created a quickstart for this.
>>>>>> Scenario is simplified. HomePage gets the data and has two submit
>>>>>> buttons.
>>>>>> Do i press the "submit" and click back on other page data are
>>>>>> present
>>>>>> (submitted).
>>>>>> Do i press the "invalid submit" and click back on other page data
>>>>>> are
>>>>>> lost.
>>>>>>
>>>>>> Here is the code
>>>>>>
>>>>>> DirtyForm.java
>>>>>> <code>
>>>>>> import org.apache.wicket.markup.html.form.Form;
>>>>>> import org.apache.wicket.model.IModel;
>>>>>>
>>>>>> public class DirtyForm<T>    extends Form<T>    {
>>>>>>
>>>>>>     public DirtyForm(String id, IModel<T>    model) {
>>>>>>         super(id, model);
>>>>>>     }
>>>>>>
>>>>>>     public final void submitTheInvalidDataToMySession() {
>>>>>>        //this seems not to be the complete solution
>>>>>>        updateFormComponentModels();
>>>>>>     }
>>>>>> }
>>>>>> </code>
>>>>>>
>>>>>> HomePage.java
>>>>>> <code>
>>>>>>
>>>>>> import org.apache.wicket.PageParameters;
>>>>>> import org.apache.wicket.markup.html.WebPage;
>>>>>> import org.apache.wicket.markup.html.form.Button;
>>>>>> import org.apache.wicket.markup.html.form.TextField;
>>>>>> import org.apache.wicket.model.PropertyModel;
>>>>>>
>>>>>> public class HomePage extends WebPage {
>>>>>>
>>>>>>     public HomePage(final PageParameters parameters) {
>>>>>>
>>>>>>         DirtyForm<String>    form;
>>>>>>         add(form = new DirtyForm<String>("form", new
>>>>>> PropertyModel<String>(new PropertyModel<Object>(this, "session"),
>>>>>> "myBusinessValue"));
>>>>>>         form.add(new TextField<String>("tf", form.getModel()));
>>>>>>         form.add(new Button("doMemorizeInvalidData") {
>>>>>>             @Override
>>>>>>             public void onSubmit() {
>>>>>>                 super.onSubmit();
>>>>>>                 DirtyForm<?>    f = findParent(DirtyForm.class);
>>>>>>                 f.submitTheInvalidDataToMySession();
>>>>>>                 setResponsePage(OtherPage.class);
>>>>>>                 setRedirect(true);
>>>>>>             };
>>>>>>         }.setDefaultFormProcessing(false));
>>>>>>         form.add(new Button("doUpdateData") {
>>>>>>             @Override
>>>>>>             public void onSubmit() {
>>>>>>                 super.onSubmit();
>>>>>>                 setResponsePage(OtherPage.class);
>>>>>>                 setRedirect(true);
>>>>>>             };
>>>>>>         });
>>>>>>     }
>>>>>> }
>>>>>> </code>
>>>>>>
>>>>>> HomePage.html
>>>>>> <code>
>>>>>> <html
>>>>>>
>>>>>> xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd"
>>>>>>
>>>>>> <head>
>>>>>> <title>Wicket Quickstart Archetype Homepage</title>
>>>>>> </head>
>>>>>> <body>
>>>>>> <strong>Wicket Quickstart Archetype Homepage</strong>
>>>>>> <br/><br/>
>>>>>> <div>
>>>>>> <form wicket:id="form">
>>>>>>                 Value:
>>>>>> <input type="text" wicket:id="tf" />
>>>>>> <input type="submit" wicket:id="doMemorizeInvalidData"
>>>>>> value="invalid
>>>>>> submit" />
>>>>>> <input type="submit" wicket:id="doUpdateData" value="submit" />
>>>>>> </form>
>>>>>> </div>
>>>>>> </body>
>>>>>> </html>
>>>>>> </code>
>>>>>>
>>>>>> MySession.java
>>>>>> <code>
>>>>>> import org.apache.wicket.Request;
>>>>>> import org.apache.wicket.protocol.http.WebSession;
>>>>>>
>>>>>> public class MySession extends WebSession {
>>>>>>
>>>>>>     private String myBusinessValue = null;
>>>>>>
>>>>>>     public MySession(Request request) {
>>>>>>         super(request);
>>>>>>     }
>>>>>>
>>>>>>     public void setMyBusinessValue(String myBusinessValue) {
>>>>>>         this.myBusinessValue = myBusinessValue;
>>>>>>     }
>>>>>>
>>>>>>     public String getMyBusinessValue() {
>>>>>>         return myBusinessValue;
>>>>>>     }
>>>>>> }
>>>>>> </code>
>>>>>>
>>>>>> OtherPage.java
>>>>>> <code>
>>>>>> import org.apache.wicket.markup.html.WebPage;
>>>>>>
>>>>>> public class OtherPage extends WebPage {
>>>>>>
>>>>>>     public OtherPage() {
>>>>>>     }
>>>>>> }
>>>>>> </code>
>>>>>>
>>>>>> OtherPage.html
>>>>>> <code>
>>>>>> <html
>>>>>>
>>>>>> xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd"
>>>>>>
>>>>>> <head>
>>>>>> <title>Wicket Quickstart Archetype Homepage</title>
>>>>>> </head>
>>>>>> <body>
>>>>>> <strong>Wicket Quickstart Archetype Homepage</strong>
>>>>>> <br/><br/>
>>>>>> <a href="/">Back</a>
>>>>>> </body>
>>>>>> </html>
>>>>>> </code>
>>>>>>
>>>>>> WicketApplication.java
>>>>>> <code>
>>>>>> import org.apache.wicket.Request;
>>>>>> import org.apache.wicket.Response;
>>>>>> import org.apache.wicket.Session;
>>>>>> import org.apache.wicket.protocol.http.WebApplication;
>>>>>>
>>>>>> public class WicketApplication extends WebApplication {
>>>>>>     @Override
>>>>>>     public Class<HomePage>    getHomePage() {
>>>>>>         return HomePage.class;
>>>>>>     }
>>>>>>
>>>>>>     @Override
>>>>>>     public Session newSession(Request request, Response response) {
>>>>>>         return new MySession(request);
>>>>>>     }
>>>>>> }
>>>>>> </code>
>>>>>>
>>>>>>> In your GoBack button's submit method (dpf = false), call
>>>>>>>
>>>>>>>     form.updateFormComponentModels()
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> *Bruno Borges *
>>>>>>> www.brunoborges.com.br
>>>>>>> +55 21 76727099
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Thu, Aug 11, 2011 at 12:08 PM, Mike Mander<[hidden email]>
>>>>>>>   wrote:
>>>>>>>
>>>>>>>> Am 11.08.2011 16:54, schrieb Bruno Borges:
>>>>>>>>
>>>>>>>>> You want to go back to another page without having to fill the
>>>>>>>>> form,
>>>>>>>>> but
>>>>>>>>> you
>>>>>>>>> also don't want to lose data you typed in in the previous screen?
>>>>>>>>> Seems
>>>>>>>>> weird to me.
>>>>>>>>>
>>>>>>>>> Have you considered to add Ajax update behaviour? onBlur of
>>>>>>>>> components,
>>>>>>>>> you
>>>>>>>>> could update the model of each component.
>>>>>>>>> *Bruno Borges*
>>>>>>>>> www.brunoborges.com.br
>>>>>>>>> +55 21 76727099
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Thu, Aug 11, 2011 at 11:50 AM, Mike Mander<[hidden email]>
>>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>>   Am 11.08.2011 16:36, schrieb Bruno Borges:
>>>>>>>>>>   Shouldn't you be submitting that button anyway? dfp = true
>>>>>>>>>>> *Bruno Borges*
>>>>>>>>>>> www.brunoborges.com.br
>>>>>>>>>>> +55 21 76727099
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On Thu, Aug 11, 2011 at 10:44 AM, Mike
>>>>>>>>>>> Mander<[hidden email]>
>>>>>>>>>>> wrote:
>>>>>>>>>>>
>>>>>>>>>>>   Hi,
>>>>>>>>>>>
>>>>>>>>>>>> i've added a domain model globally to my session.
>>>>>>>>>>>>
>>>>>>>>>>>> A form for editing this data is provided on page A. On this
>>>>>>>>>>>> i have
>>>>>>>>>>>> 2
>>>>>>>>>>>> submit
>>>>>>>>>>>> buttons. One with setDefaultFormProcessing false (to
>>>>>>>>>>>> previous page)
>>>>>>>>>>>> and
>>>>>>>>>>>> one
>>>>>>>>>>>> with true (to next step).
>>>>>>>>>>>>
>>>>>>>>>>>> If i press the main submit (next step | dfp = true) then
>>>>>>>>>>>> everything
>>>>>>>>>>>> works
>>>>>>>>>>>> as expected. If i press the other (previous page |dfp =
>>>>>>>>>>>> false) and
>>>>>>>>>>>> redirect
>>>>>>>>>>>> to Page A all data are lost. I'm absolutely aware of the
>>>>>>>>>>>> issue that
>>>>>>>>>>>> false
>>>>>>>>>>>> in
>>>>>>>>>>>> defaultFormProcessing is not submitting the data.
>>>>>>>>>>>>
>>>>>>>>>>>> But because i cannot reproduce the input changed part of
>>>>>>>>>>>> the form
>>>>>>>>>>>> processing, i can't submit the invalid data manually. Is
>>>>>>>>>>>> there any
>>>>>>>>>>>> way
>>>>>>>>>>>> to
>>>>>>>>>>>> achieve my goal?
>>>>>>>>>>>>
>>>>>>>>>>>> Thanks
>>>>>>>>>>>> Mike
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> ------------------------------******--------------------------**--**
>>>>>>>>>>>>
>>>>>>>>>>>> --**---------
>>>>>>>>>>>> To unsubscribe, e-mail:
>>>>>>>>>>>> users-unsubscribe@wicket.****apa**che.org<
>>>>>>>>>>>> http://apache.org**>
>>>>>>>>>>>> <users-unsubscribe@**wicket.**apache.org<http://wicket.apache.org><
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> users-unsubscribe@**wicket.apache.org<[hidden email]>
>>>>>>>>>>>>
>>>>>>>>>>>> For additional commands, e-mail: [hidden email]
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>   Then i can't goback to previous page without filling the
>>>>>>>>>>>> form.
>>>>>>>>>>>>
>>>>>>>>>>> The scenario is
>>>>>>>>>> 1. goto basket
>>>>>>>>>> 2. goto checkout (Page A in post) enter some data
>>>>>>>>>> 3. goback to basket (dfp = false) validation should be bypassed
>>>>>>>>>> 4. goto checkout =>       all entered data are present
>>>>>>>>>>
>>>>>>>>>> But until now with this scenario i lost all data in step 4
>>>>>>>>>>
>>>>>>>>>> Thanks
>>>>>>>>>> Mike
>>>>>>>>>>
>>>>>>>>>> PS: I use buttons to stay in javascript-less mode :-)
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> ------------------------------****----------------------------**
>>>>>>>>>> --**---------
>>>>>>>>>> To unsubscribe, e-mail:
>>>>>>>>>> users-unsubscribe@wicket.**apa**che.org<http://apache.org>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> <users-unsubscribe@**wicket.apache.org<[hidden email]>
>>>>>>>>>>
>>>>>>>>>> For additional commands, e-mail: [hidden email]
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>   Ajax is not an option - i have to stay javascript-less.
>>>>>>>>    You want to go back to another page without having to fill
>>>>>>>> the form,
>>>>>>>> but
>>>>>>>>> you
>>>>>>>>>   also don't want to lose data you typed in in the previous
>>>>>>>>> screen?
>>>>>>>>> Seems
>>>>>>>>>   weird to me.
>>>>>>>>>
>>>>>>>> Not the previous screen. The current screen.
>>>>>>>>
>>>>>>>> I come from basket. I goto checkout. I start typing. I think
>>>>>>>> oops what
>>>>>>>> was
>>>>>>>> the option in basket
>>>>>>>> and goback to basket (dfp = false). I check the basket option
>>>>>>>> and think
>>>>>>>> ok
>>>>>>>> let's go on checkout.
>>>>>>>> And on checkout i think - damn all typed data have gone. So i
>>>>>>>> leave the
>>>>>>>> shop.
>>>>>>>>
>>>>>>>> That's the scenario i try to catch.
>>>>>>>>
>>>>>>>>
>>>>>>>> Thanks
>>>>>>>> Mike
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> ------------------------------**------------------------------**---------
>>>>>>>>
>>>>>>>> To unsubscribe, e-mail:
>>>>>>>>
>>>>>>>> users-unsubscribe@wicket.**apache.org<[hidden email]>
>>>>>>>>
>>>>>>>> For additional commands, e-mail: [hidden email]
>>>>>>>>
>>>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>>
>>>>>> To unsubscribe, e-mail: [hidden email]
>>>>>> For additional commands, e-mail: [hidden email]
>>>>>>
>>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: [hidden email]
>>>>> For additional commands, e-mail: [hidden email]
>>>>>
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [hidden email]
>>>> For additional commands, e-mail: [hidden email]
>>>>
>>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Form looses data

Martin Makundi
In reply to this post by Mike Mander
I think wicket needs some sort of "conversation" scope like Seam
does... that should cover it.

**
Martin

2011/8/12 Mike Mander <[hidden email]>:

> But if wicket should support it out of the box there is maybe another way.
> If we could get a method onBeforeFormSubmit() in form there would be
> an access point to configure validators in all childs.
> In default nothing is to do - means leave form as configured at creation
> time.
> If it's nessecary i could set a flag or something to validate components
> conditional.
>
> Form.java
> ...
>
> protected void onBeforeFormSubmit() {
>  if (findSubmittingButton.getId().equals("mySpecialButton")) {
>    setGlobalFlag(true);
>  } else {
>    setGlobalFlag(false);
>  }
> }
>
> and in Validator
> MyValidator.java
> void validate(IValidatable<T> validatable) {
>  if (!getGlobalFlag()) {
>    doValidation();
>  }
> }
>
> That would make it possibly unnessecary to store the component references in
> session.
> Or are there other usecases i don't see for ReuseManager.
>
>> AH.... not to say that I would mind if wicket would handle
>> reusemanager itself.. I wonder if it is there in 1.5? Hmm.. I think a
>> proposal should be added to the whishlist.
>>
>> **
>> Martin
>>
>> 2011/8/12 Martin Makundi<[hidden email]>:
>>>
>>> The Form way is a quirk way to do it in the first place. You are not
>>> supposed to update model before validation etc. so you will run into
>>> lots of troubles that way.
>>>
>>> Reusemanager simply works like wicket normally works when you validate
>>> and repaint the screen with rawInput values. It just keeps those
>>> components and copies the old rawInput value which was persisted
>>> during incomplete submit.
>>>
>>> **
>>> Martin
>>>
>>> 2011/8/12 Mike Mander<[hidden email]>:
>>>>
>>>> Thanks Martin,
>>>>
>>>> now it works as expected. I don't have a clue how but it is.
>>>> I really would be interested in knowing why the reusemanager gets the
>>>> data
>>>> and the form not.
>>>>
>>>> I think i will start a debugging session at weekend :-)
>>>>
>>>> Maybe we should use this scenario and put it in the wiki? Especially in
>>>> shop
>>>> environments it's
>>>> a big frustration point if form values is lost only because i want to
>>>> see
>>>> what i typed in last page.
>>>> And ask the user to provide all data until validation passes is
>>>> decreasing
>>>> the conversion rate :-(
>>>> So maybe others will benefit from the found / working solution to.
>>>>
>>>> Thanks again
>>>> Mike
>>>>
>>>>> This is how you can do it with reusemanager:
>>>>>
>>>>>
>>>>> HomePage:
>>>>> public class HomePage extends WebPage {
>>>>>        public HomePage(final PageParameters parameters) {
>>>>>        Form<Void>    form;
>>>>>                        add(form = new Form<Void>("form"));
>>>>>
>>>>>
>>>>>  form.add(WicketSession.get().getReuseManager().rememberOrReuseAndProvideFeedback(HomePage.class.getSimpleName()
>>>>> + "tf", new TextField<String>("tf", Model.of(""))));
>>>>>        form.add(new Button("doMemorizeInvalidData") {
>>>>>            @Override
>>>>>            public void onSubmit() {
>>>>>                super.onSubmit();
>>>>>                setResponsePage(OtherPage.class);
>>>>>                setRedirect(true);
>>>>>            };
>>>>>        }.setDefaultFormProcessing(false));
>>>>>        form.add(new Button("doUpdateData") {
>>>>>            @Override
>>>>>            public void onSubmit() {
>>>>>                super.onSubmit();
>>>>>                setResponsePage(OtherPage.class);
>>>>>                setRedirect(true);
>>>>>            };
>>>>>        });
>>>>>    }
>>>>> }
>>>>>
>>>>>
>>>>> Reusemanager holder (can be session, can be something else):
>>>>>
>>>>> public class WicketSession extends WebSession {
>>>>>        /**
>>>>>         *
>>>>>         */
>>>>>        private static final long serialVersionUID = 1L;
>>>>>
>>>>>        private final FormComponentReuseManager reuseManager = new
>>>>> FormComponentReuseManager();
>>>>>
>>>>>        public FormComponentReuseManager getReuseManager() {
>>>>>                return reuseManager;
>>>>>        }
>>>>>
>>>>>        /**
>>>>>         * @param request
>>>>>         */
>>>>>        public WicketSession(Request request) {
>>>>>                super(request);
>>>>>        }
>>>>>
>>>>>        /**
>>>>>         * @return WicketSession
>>>>>         */
>>>>>        public static WicketSession get() {
>>>>>                return (WicketSession) Session.get();
>>>>>        }
>>>>> }
>>>>>
>>>>>
>>>>> **
>>>>> Martin
>>>>>
>>>>> 2011/8/12 Mike Mander<[hidden email]>:
>>>>>>
>>>>>> That is not working to. I've created a quickstart for this.
>>>>>> Scenario is simplified. HomePage gets the data and has two submit
>>>>>> buttons.
>>>>>> Do i press the "submit" and click back on other page data are present
>>>>>> (submitted).
>>>>>> Do i press the "invalid submit" and click back on other page data are
>>>>>> lost.
>>>>>>
>>>>>> Here is the code
>>>>>>
>>>>>> DirtyForm.java
>>>>>> <code>
>>>>>> import org.apache.wicket.markup.html.form.Form;
>>>>>> import org.apache.wicket.model.IModel;
>>>>>>
>>>>>> public class DirtyForm<T>    extends Form<T>    {
>>>>>>
>>>>>>    public DirtyForm(String id, IModel<T>    model) {
>>>>>>        super(id, model);
>>>>>>    }
>>>>>>
>>>>>>    public final void submitTheInvalidDataToMySession() {
>>>>>>       //this seems not to be the complete solution
>>>>>>       updateFormComponentModels();
>>>>>>    }
>>>>>> }
>>>>>> </code>
>>>>>>
>>>>>> HomePage.java
>>>>>> <code>
>>>>>>
>>>>>> import org.apache.wicket.PageParameters;
>>>>>> import org.apache.wicket.markup.html.WebPage;
>>>>>> import org.apache.wicket.markup.html.form.Button;
>>>>>> import org.apache.wicket.markup.html.form.TextField;
>>>>>> import org.apache.wicket.model.PropertyModel;
>>>>>>
>>>>>> public class HomePage extends WebPage {
>>>>>>
>>>>>>    public HomePage(final PageParameters parameters) {
>>>>>>
>>>>>>        DirtyForm<String>    form;
>>>>>>        add(form = new DirtyForm<String>("form", new
>>>>>> PropertyModel<String>(new PropertyModel<Object>(this, "session"),
>>>>>> "myBusinessValue"));
>>>>>>        form.add(new TextField<String>("tf", form.getModel()));
>>>>>>        form.add(new Button("doMemorizeInvalidData") {
>>>>>>            @Override
>>>>>>            public void onSubmit() {
>>>>>>                super.onSubmit();
>>>>>>                DirtyForm<?>    f = findParent(DirtyForm.class);
>>>>>>                f.submitTheInvalidDataToMySession();
>>>>>>                setResponsePage(OtherPage.class);
>>>>>>                setRedirect(true);
>>>>>>            };
>>>>>>        }.setDefaultFormProcessing(false));
>>>>>>        form.add(new Button("doUpdateData") {
>>>>>>            @Override
>>>>>>            public void onSubmit() {
>>>>>>                super.onSubmit();
>>>>>>                setResponsePage(OtherPage.class);
>>>>>>                setRedirect(true);
>>>>>>            };
>>>>>>        });
>>>>>>    }
>>>>>> }
>>>>>> </code>
>>>>>>
>>>>>> HomePage.html
>>>>>> <code>
>>>>>> <html
>>>>>>
>>>>>>
>>>>>> xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd"
>>>>>> <head>
>>>>>> <title>Wicket Quickstart Archetype Homepage</title>
>>>>>> </head>
>>>>>> <body>
>>>>>> <strong>Wicket Quickstart Archetype Homepage</strong>
>>>>>> <br/><br/>
>>>>>> <div>
>>>>>> <form wicket:id="form">
>>>>>>                Value:
>>>>>> <input type="text" wicket:id="tf" />
>>>>>> <input type="submit" wicket:id="doMemorizeInvalidData" value="invalid
>>>>>> submit" />
>>>>>> <input type="submit" wicket:id="doUpdateData" value="submit" />
>>>>>> </form>
>>>>>> </div>
>>>>>> </body>
>>>>>> </html>
>>>>>> </code>
>>>>>>
>>>>>> MySession.java
>>>>>> <code>
>>>>>> import org.apache.wicket.Request;
>>>>>> import org.apache.wicket.protocol.http.WebSession;
>>>>>>
>>>>>> public class MySession extends WebSession {
>>>>>>
>>>>>>    private String myBusinessValue = null;
>>>>>>
>>>>>>    public MySession(Request request) {
>>>>>>        super(request);
>>>>>>    }
>>>>>>
>>>>>>    public void setMyBusinessValue(String myBusinessValue) {
>>>>>>        this.myBusinessValue = myBusinessValue;
>>>>>>    }
>>>>>>
>>>>>>    public String getMyBusinessValue() {
>>>>>>        return myBusinessValue;
>>>>>>    }
>>>>>> }
>>>>>> </code>
>>>>>>
>>>>>> OtherPage.java
>>>>>> <code>
>>>>>> import org.apache.wicket.markup.html.WebPage;
>>>>>>
>>>>>> public class OtherPage extends WebPage {
>>>>>>
>>>>>>    public OtherPage() {
>>>>>>    }
>>>>>> }
>>>>>> </code>
>>>>>>
>>>>>> OtherPage.html
>>>>>> <code>
>>>>>> <html
>>>>>>
>>>>>>
>>>>>> xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd"
>>>>>> <head>
>>>>>> <title>Wicket Quickstart Archetype Homepage</title>
>>>>>> </head>
>>>>>> <body>
>>>>>> <strong>Wicket Quickstart Archetype Homepage</strong>
>>>>>> <br/><br/>
>>>>>> <a href="/">Back</a>
>>>>>> </body>
>>>>>> </html>
>>>>>> </code>
>>>>>>
>>>>>> WicketApplication.java
>>>>>> <code>
>>>>>> import org.apache.wicket.Request;
>>>>>> import org.apache.wicket.Response;
>>>>>> import org.apache.wicket.Session;
>>>>>> import org.apache.wicket.protocol.http.WebApplication;
>>>>>>
>>>>>> public class WicketApplication extends WebApplication {
>>>>>>    @Override
>>>>>>    public Class<HomePage>    getHomePage() {
>>>>>>        return HomePage.class;
>>>>>>    }
>>>>>>
>>>>>>    @Override
>>>>>>    public Session newSession(Request request, Response response) {
>>>>>>        return new MySession(request);
>>>>>>    }
>>>>>> }
>>>>>> </code>
>>>>>>
>>>>>>> In your GoBack button's submit method (dpf = false), call
>>>>>>>
>>>>>>>    form.updateFormComponentModels()
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> *Bruno Borges *
>>>>>>> www.brunoborges.com.br
>>>>>>> +55 21 76727099
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Thu, Aug 11, 2011 at 12:08 PM, Mike Mander<[hidden email]>
>>>>>>>  wrote:
>>>>>>>
>>>>>>>> Am 11.08.2011 16:54, schrieb Bruno Borges:
>>>>>>>>
>>>>>>>>> You want to go back to another page without having to fill the
>>>>>>>>> form,
>>>>>>>>> but
>>>>>>>>> you
>>>>>>>>> also don't want to lose data you typed in in the previous screen?
>>>>>>>>> Seems
>>>>>>>>> weird to me.
>>>>>>>>>
>>>>>>>>> Have you considered to add Ajax update behaviour? onBlur of
>>>>>>>>> components,
>>>>>>>>> you
>>>>>>>>> could update the model of each component.
>>>>>>>>> *Bruno Borges*
>>>>>>>>> www.brunoborges.com.br
>>>>>>>>> +55 21 76727099
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Thu, Aug 11, 2011 at 11:50 AM, Mike Mander<[hidden email]>
>>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>>  Am 11.08.2011 16:36, schrieb Bruno Borges:
>>>>>>>>>>
>>>>>>>>>>  Shouldn't you be submitting that button anyway? dfp = true
>>>>>>>>>>>
>>>>>>>>>>> *Bruno Borges*
>>>>>>>>>>> www.brunoborges.com.br
>>>>>>>>>>> +55 21 76727099
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On Thu, Aug 11, 2011 at 10:44 AM, Mike Mander<[hidden email]>
>>>>>>>>>>> wrote:
>>>>>>>>>>>
>>>>>>>>>>>  Hi,
>>>>>>>>>>>
>>>>>>>>>>>> i've added a domain model globally to my session.
>>>>>>>>>>>>
>>>>>>>>>>>> A form for editing this data is provided on page A. On this i
>>>>>>>>>>>> have
>>>>>>>>>>>> 2
>>>>>>>>>>>> submit
>>>>>>>>>>>> buttons. One with setDefaultFormProcessing false (to previous
>>>>>>>>>>>> page)
>>>>>>>>>>>> and
>>>>>>>>>>>> one
>>>>>>>>>>>> with true (to next step).
>>>>>>>>>>>>
>>>>>>>>>>>> If i press the main submit (next step | dfp = true) then
>>>>>>>>>>>> everything
>>>>>>>>>>>> works
>>>>>>>>>>>> as expected. If i press the other (previous page |dfp = false)
>>>>>>>>>>>> and
>>>>>>>>>>>> redirect
>>>>>>>>>>>> to Page A all data are lost. I'm absolutely aware of the issue
>>>>>>>>>>>> that
>>>>>>>>>>>> false
>>>>>>>>>>>> in
>>>>>>>>>>>> defaultFormProcessing is not submitting the data.
>>>>>>>>>>>>
>>>>>>>>>>>> But because i cannot reproduce the input changed part of the
>>>>>>>>>>>> form
>>>>>>>>>>>> processing, i can't submit the invalid data manually. Is there
>>>>>>>>>>>> any
>>>>>>>>>>>> way
>>>>>>>>>>>> to
>>>>>>>>>>>> achieve my goal?
>>>>>>>>>>>>
>>>>>>>>>>>> Thanks
>>>>>>>>>>>> Mike
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> ------------------------------******--------------------------**--**
>>>>>>>>>>>> --**---------
>>>>>>>>>>>> To unsubscribe, e-mail:
>>>>>>>>>>>> users-unsubscribe@wicket.****apa**che.org<
>>>>>>>>>>>> http://apache.org**>
>>>>>>>>>>>>
>>>>>>>>>>>> <users-unsubscribe@**wicket.**apache.org<http://wicket.apache.org><
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> users-unsubscribe@**wicket.apache.org<[hidden email]>
>>>>>>>>>>>> For additional commands, e-mail: [hidden email]
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>  Then i can't goback to previous page without filling the form.
>>>>>>>>>>>>
>>>>>>>>>>> The scenario is
>>>>>>>>>>
>>>>>>>>>> 1. goto basket
>>>>>>>>>> 2. goto checkout (Page A in post) enter some data
>>>>>>>>>> 3. goback to basket (dfp = false) validation should be bypassed
>>>>>>>>>> 4. goto checkout =>       all entered data are present
>>>>>>>>>>
>>>>>>>>>> But until now with this scenario i lost all data in step 4
>>>>>>>>>>
>>>>>>>>>> Thanks
>>>>>>>>>> Mike
>>>>>>>>>>
>>>>>>>>>> PS: I use buttons to stay in javascript-less mode :-)
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> ------------------------------****----------------------------**
>>>>>>>>>> --**---------
>>>>>>>>>> To unsubscribe, e-mail:
>>>>>>>>>> users-unsubscribe@wicket.**apa**che.org<http://apache.org>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> <users-unsubscribe@**wicket.apache.org<[hidden email]>
>>>>>>>>>> For additional commands, e-mail: [hidden email]
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>  Ajax is not an option - i have to stay javascript-less.
>>>>>>>>
>>>>>>>>   You want to go back to another page without having to fill the
>>>>>>>> form,
>>>>>>>> but
>>>>>>>>>
>>>>>>>>> you
>>>>>>>>>  also don't want to lose data you typed in in the previous screen?
>>>>>>>>> Seems
>>>>>>>>>  weird to me.
>>>>>>>>>
>>>>>>>> Not the previous screen. The current screen.
>>>>>>>>
>>>>>>>> I come from basket. I goto checkout. I start typing. I think oops
>>>>>>>> what
>>>>>>>> was
>>>>>>>> the option in basket
>>>>>>>> and goback to basket (dfp = false). I check the basket option and
>>>>>>>> think
>>>>>>>> ok
>>>>>>>> let's go on checkout.
>>>>>>>> And on checkout i think - damn all typed data have gone. So i leave
>>>>>>>> the
>>>>>>>> shop.
>>>>>>>>
>>>>>>>> That's the scenario i try to catch.
>>>>>>>>
>>>>>>>>
>>>>>>>> Thanks
>>>>>>>> Mike
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> ------------------------------**------------------------------**---------
>>>>>>>> To unsubscribe, e-mail:
>>>>>>>>
>>>>>>>>
>>>>>>>> users-unsubscribe@wicket.**apache.org<[hidden email]>
>>>>>>>> For additional commands, e-mail: [hidden email]
>>>>>>>>
>>>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: [hidden email]
>>>>>> For additional commands, e-mail: [hidden email]
>>>>>>
>>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: [hidden email]
>>>>> For additional commands, e-mail: [hidden email]
>>>>>
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [hidden email]
>>>> For additional commands, e-mail: [hidden email]
>>>>
>>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

12