Well, I would generaly not put navigation logic to form's onSubmit. I
always use button's onSubmit for things like that. I actually use
Form.onSubmit rather rarely.

But i didn't vote -1 for this.

-Matej

On 3/26/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
i find that funny coming from you seeing how you are the one who came up
with nesting forms.

if you do your navigation logic inside the form's onsubmit and you nest
forms it will be broken wont it? that only leaves you one place to do
navigation logic, which is the button's onsubmit. but everything else must
be processed before you can decide where to navigate to - which makes form's
onsubmit useless. so if you think you have a usecase where your form might
be nested and you want to do navigation then you must do it in the button's
onsubmit. take reusability into account and then that always becomes the
case.

-igor


On 3/25/07, Matej Knopp <[EMAIL PROTECTED]> wrote:
>
> I haven't read the whole discussion so I might be missing something.
> But I, personally, find calling button's onSubmit before form's more
> intuitive.
>
> -Matej
>
> On 3/25/07, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
> > +1
> >
> > Eelco
> >
> >
> > On 3/24/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> > > so should we change this in 1.3?
> > >
> > > -igor
> > >
> > >
> > > On 2/15/07, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
> > > >
> > > > I agree with it now too. A typical thing you want to do in a button
> is
> > > > do a component replacement (at least, that's what we do often here)
> of
> > > > a component above the form. The problem with buttons being called
> > > > before the form's onSubmit is that then the component is already
> > > > detached from the page.
> > > >
> > > > Eelco
> > > >
> > > >
> > > > On 2/15/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> > > > > i am going to resurrect this discussion again since we now have
> more
> > > > > committers and none of you old ones have agreed with me before! i
> still
> > > > > think this
> > > > > is a good idea!
> > > > >
> > > > > the old thread can be seen here:
> > > > >
> > > > >
> > > >
> http://www.nabble.com/form.onsubmit-vs-button.onsubmit-tf1977859.html#a5431105
> > > > >
> > > > > -igor
> > > > >
> > > > >
> > > > > ---------- Forwarded message ----------
> > > > > From: Igor Vaynberg <[EMAIL PROTECTED]>
> > > > > Date: Jul 20, 2006 3:55 PM
> > > > > Subject: form.onsubmit vs button.onsubmit
> > > > > To: wicket-develop@lists.sourceforge.net
> > > > >
> > > > > i just noticed that we call button.onsubmit() /before/
> form.onsubmit(),
> > > > i
> > > > > always believed this to be the other way around because that is
> more
> > > > > intuitive - cascading onsubmit down the component hierarchy. is
> there a
> > > > > reason why we do it "backwards"?
> > > > >
> > > > > i have also noticed a pattern where i group certain fields in a
> panel
> > > > and
> > > > > would like to let the panel also have an onsubmit() for
> processing.  i
> > > > was
> > > > > thinking of implementing IFormSubmitAware { void onSubmit(); } and
> > > > bubble
> > > > > this down via a visitor in form.delegatesubmit() but of course
> with the
> > > > > button getting called first it makes no sense.
> > > > >
> > > > > shall we reverse it in 2.0? should i put the iformsubmitaware into
> 2.0core?
> > > > >
> > > > > -Igor
> > > > >
> > > >
> > >
> >
>

Reply via email to