Cool! I guess I just didn't realize that it is OK to store state in your own
instance of Form like your example below.
Thanks for the answer --
igor.vaynberg wrote:
>
> class myform extends form {
> private boolean submitted=false;
>
> protected abstract void oninitialsubmit();
> protected abstract void onresubmit();
>
> protected final void onsubmitted() {
> if (!submitted) oninitialsubmit(); else onresubmit();
> submitted=true;
> }
> }
>
> why does wicket need a special mechanism?
>
>
> On Nov 19, 2007 6:57 PM, saenz <[EMAIL PROTECTED]> wrote:
>>
>> I agree -- I had a question about this very topic. I was going to ask:
>>
>> Does Wicket have any mechanism to notify the application that a form from
>> a
>> previous page has been re-submitted (the situation you describe below)?
>>
>> This is so that the application can decide what to do -- in some cases,
>> the
>> best action might be to ignore the re-submission; in other cases, it
>> might
>> be correct to handle it the same way as the initial submission.
>>
>> Example: In the Form.onSubmit() or the Button.onSubmit() method, is there
>> was a way to get the Page context (including the version) so that the
>> application to find out if the request is coming from an older version of
>> the page (and therefore must be due to a back-button navigation followed
>> by
>> a form re-submit)?
>>
>>
>> Johan Compagner wrote:
>> >
>> > But a user can click the back button to go to the previous page with
>> > the form and submit it again, but that isn't something wicket should
>> > prevent. Because that could be valid for that application, a user
>> > submit something then sees it made a mistake, presses back, corrects
>> > it and submit again..
>
--
View this message in context:
http://www.nabble.com/double-form-submission-handling---tf4829048.html#a13851026
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]