C with default value 'false' -> default does not process inner form.
IMO a form in a panel is not *typically* designed for processing in an
outer form.

Take for instance:

Form outer = new Form(this, "outer") {
   protected void onSubmit() {
       session.save(getModelObject());
   }
}

Form inner0 = new Form(outer, "inner0") {
   protected boolean processOnParentSubmit() {
       return false;
   }
   protected void onSubmit() {
       session.save(getModelObject());
   }
}

Form inner1 = new Form(outer, "inner1") {
   protected boolean processOnParentSubmit() {
       return false;
   }
   protected void onSubmit() {
       session.save(getModelObject());
   }
}

Form inner2 = new Form(inner1, "inner2") {
   protected void onSubmit() {
       session.save(getModelObject());
   }
}

This could lead to double saves, or save and delete, or any other
strange behavior. Setting the default to process inner form breaks the
encapsulation of the form.

Also what is the semantics of the flag on inner form 1 with regards to
the processing of inner form 2?

Martijn

On 11/6/06, Matej Knopp <[EMAIL PROTECTED]> wrote:
Hi.

As you may have noticed, we have nested forms support in Wicket 2.0.

(Please, this is not about whether we should/should not support nested
forms, so don't discuss it in this thread).

The question is, what should happen with inner forms, when outer forms
are submitted.

a) Inner forms should be processed, calling onSubmit() on each of them
b) Inner forms should not be processed, just preserving user input is fine.
c) Make this configurable per form,
    e.g. each form would have method like processOnParentSubmit(), which
could return true, which would cause this form to be processed, when a
form in parent hierarchy is submitted.

I vote for C.

-Matej



--
<a href="http://www.thebeststuffintheworld.com/vote_for/wicket";>Vote</a>
for <a href="http://www.thebeststuffintheworld.com/stuff/wicket";>Wicket</a>
at the <a href="http://www.thebeststuffintheworld.com/";>Best Stuff in
the World!</a>

Reply via email to