Hi Sebastien,

1) How did you push into https://github.com/apache/wicket without pushing
at Apache Git repo? :-)
I always thought that this repo is a mirror of Apache Git repo and
read-only for anything else.

2) Please create a Pull Request so we can see all commit changes in the
same compare UI view

3) The call to visit.dontGoDeeper() at
https://github.com/apache/wicket/blob/cd3b92346b33b38c451434a1cabb7cf79d7188f0/wicket-core/src/main/java/org/apache/wicket/markup/html/form/Form.java#L1013
looks to me that Wicket won't work as expected for several layers nesting.
The test you extend seems to deal with outer/middle/inner so I must be
missing something.
While you are "in the zone" - could you explain what happens?

4) Please change the methods to 'protected' for master branch. There is no
reason to keep them public as Carl-Eric explained.


Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Mon, Apr 20, 2015 at 7:54 PM, Sebastien <[email protected]> wrote:

> Hi,
>
> By doing the Unit Test, I realized that a *middle* form having
> #wantSubmitOnParentFormSubmit false did not prevent an *inner* form from
> being "submitted" (*outer* is being submitted in this case)
>
> The problem is in #delegateSubmit which uses a visitPostOrder (inner to
> outer), so we cannot stop the visitor...
> I think this can be easily solved just by checking the FLAG_SUBMITTED,
> which is set at the very beginning of a form submission
> (#markFormsSubmitted) with the exact same condition.
>
> The code (and unit test) now looks like:
>
> https://github.com/apache/wicket/commit/c04d341869a0928a556c0bb35ba06621a93e7a51
>
> Please have a cautious look, in case I would have missed something...
>
> Thanks & best regards,
> Sebastien.
>
>
>
> On Mon, Apr 20, 2015 at 3:00 PM, Sebastien <[email protected]> wrote:
>
> > > Is there any reason why the #wantSubmitOnXyz() methods should be public
> > and
> > not protected?
> >
> > I prefer to be protected too, but as #wantSubmitOnNestedFormSubmit was
> > public, I aligned on that.
> >
> >
> >
> >
> > On Mon, Apr 20, 2015 at 2:53 PM, Martin Grigorov <[email protected]>
> > wrote:
> >
> >> Hi,
> >>
> >> Looks OK to me.
> >> Please add unit (WicketTester) tests for it.
> >>
> >> Is there any reason why the #wantSubmitOnXyz() methods should be public
> >> and
> >> not protected?
> >> @Carl-Eric: I think you added #wantSubmitOnNestedFormSubmit(). Any
> problem
> >> if this is protected in 7.x?
> >>
> >> Martin Grigorov
> >> Wicket Training and Consulting
> >> https://twitter.com/mtgrigorov
> >>
> >> On Mon, Apr 20, 2015 at 3:44 PM, Sebastien <[email protected]> wrote:
> >>
> >> > Hi devs,
> >> >
> >> > I have a recurrent use case where I need to prevent a nested form to
> be
> >> > processed/validated/submitted. There is already some conditions that
> >> could
> >> > achieve this (Form#isEnabledInHierarchy or #isVisibleInHierarchy), but
> >> it
> >> > does not suit well in case of a component/widget which is shown/hidden
> >> > using javascript only (like a Dialog for instance).
> >> >
> >> > Form has a #wantSubmitOnNestedFormSubmit method (default to false),
> >> which
> >> > allows to submit a parent form when the nested form is posted. I was
> >> > thinking about having a #wantSubmitOnParentFormSubmit (default to
> true)
> >> > which does the opposite: preventing a nested form to be submitted.
> >> >
> >> > You can see the code proposal here:
> >> >
> >> >
> >>
> https://github.com/apache/wicket/commit/e29a7a08a59c9897dcaf3f5df1661cc03a04b644
> >> >
> >> > (btw, there is/was an error L1014/1025)
> >> >
> >> > What do you think?
> >> >
> >> > Best regards,
> >> > Sebastien.
> >> >
> >>
> >
> >
>

Reply via email to