You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Martijn Dashorst <ma...@gmail.com> on 2006/11/04 17:48:42 UTC

Nested forms

I was surprised to see the nested forms working, but I have a question
on what happens with the inner form inputs when the outer form is
submitted:

<form wicket:id="outer">
    <input type="text" wicket:id="field" />
    <form wicket:id="inner">
        <input type="text" wicket:id="field" />
        <input type="submit" wicket:id="innerSave" />
    </form>
    <input type="submit" wicket:id="outerSave" />
</form>

public class MyPage extends WebPage {
    private String inner;
    private String outer;

    public MyPage() {
        Form outer = new Form(this, "outer");
        new TextField(outer, "field", new PropertyModel(this, "outer"));
        Form inner = new Form(outer, "inner");
        new TextField(inner, "field", new PropertyModel(this, "inner"));
        new Button(outer, "outerSave") {};
        new Button(inner, "innerSave") {};
    }
}

If the user clicks the inner button, only the inner fields are processed.

If the user clicks the outer button, both the inner and outer fields
are processed, but the inner forms 'onSubmit' is not called.

Two questions:
 1. should the inner fields be processed and update their models?
 2. should the inner onSubmit/onError be called when the outer is submitted?

Martijn
-- 
<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>

Re: Nested forms

Posted by Matej Knopp <ma...@knopp.sk>.
Martijn Dashorst wrote:
> I was surprised to see the nested forms working, but I have a question
> on what happens with the inner form inputs when the outer form is
> submitted:
> 
> <form wicket:id="outer">
>    <input type="text" wicket:id="field" />
>    <form wicket:id="inner">
>        <input type="text" wicket:id="field" />
>        <input type="submit" wicket:id="innerSave" />
>    </form>
>    <input type="submit" wicket:id="outerSave" />
> </form>
> 
> public class MyPage extends WebPage {
>    private String inner;
>    private String outer;
> 
>    public MyPage() {
>        Form outer = new Form(this, "outer");
>        new TextField(outer, "field", new PropertyModel(this, "outer"));
>        Form inner = new Form(outer, "inner");
>        new TextField(inner, "field", new PropertyModel(this, "inner"));
>        new Button(outer, "outerSave") {};
>        new Button(inner, "innerSave") {};
>    }
> }
> 
> If the user clicks the inner button, only the inner fields are processed.
> 
> If the user clicks the outer button, both the inner and outer fields
> are processed, but the inner forms 'onSubmit' is not called.
> 
> Two questions:
> 1. should the inner fields be processed and update their models?
> 2. should the inner onSubmit/onError be called when the outer is submitted?
> 
Heh, those are good questions. I think inner forms should be processed, 
and their onSubmit/onError methods should be called (this seems to be 
the most intuitive behavior to me).

-Matej
> Martijn


Re: AW: AW: Nested forms

Posted by Martijn Dashorst <ma...@gmail.com>.
This has nothing to do with extending or inheritence.

The idea is that sometimes you have a form inside of which you want to
nest other components such as panels. Previously you have to design
your panels such that they don't have a form inside, imposing the
requirement of adding the form on the user of the panel.

This breaks the component encapsulation and therefore I came up with
allowing the nesting of forms. The question here is whether the inputs
of the inner form should be updated and processed when the outer form
is submitted.

The longer I think about it, I seriously don't think it is wise to do
so. I'll create a proposal for this with a vote.

Martijn

On 11/5/06, Korbinian Bachl <ko...@whiskyworld.de> wrote:
> Hi Johan,
>
> the idea of me was that the outer form extends the inner - as this is closes
> to what happens in html. So yo still can process the inner one, as is a
> complete form, but when the outer one is processed, the inner onSubmit etc.
> is overriden and therefore no other misunderstandings and errors should
> occur. This is also closest to the html form that is coming out - the inner
> one can be processed, but if you do the outer one then the inner is
> processed too (in case of formouter extends form inner) and solely processed
> in case of outer form doenst extend inner form.
>
> that is should be 2 seperate form is ok, if the developer wants to tread
> them seperately, if he wants to tread them together, he may use the outer
> extending the inner. Sounds quite basic and easy to me.
>
> Regards
>
> Korbinian
>
>
> > -----Ursprüngliche Nachricht-----
> > Von: Johan Compagner [mailto:jcompagner@gmail.com]
> > Gesendet: Samstag, 4. November 2006 23:02
> > An: wicket-dev@incubator.apache.org
> > Betreff: Re: AW: Nested forms
> >
> > what do you mean extend the inner form? as in java extend?
> > Why should you do that as developer. then just have one form.
> > What does that inner do then?
> >
> > It should be just 2 seperate forms (on the java side) and if
> > possible we should know what button (so what form) is
> > submitted so that only one is processed The other should keep
> > the rawinput for the next render.
> >
> > johan
> >
> >
> > On 11/4/06, Korbinian Bachl <ko...@whiskyworld.de> wrote:
> > >
> > > hmm.. I like that idea. If this is a wicket only thing, you
> > might want
> > > to let the programmer decide what should be  happening..
> > perhaps the
> > > outer form has to extend the inner one if it should be  act
> > like 1 big
> > > form, if you dont extend it, they are acting as 2 own forms instead?
> > >
> > > Regards
> > >
> > > > -----Ursprüngliche Nachricht-----
> > > > Von: Matej Knopp [mailto:matej@knopp.sk]
> > > > Gesendet: Samstag, 4. November 2006 18:38
> > > > An: wicket-dev@incubator.apache.org
> > > > Betreff: Re: AW: Nested forms
> > > >
> > > > Indeed, nesting html forms it not allowed. Therefore we
> > have nested
> > > > forms support in 2.0. If you nest form copmonents, the
> > inner <form
> > > > tags will be replaced by <div>s.
> > > >
> > > > When the inner form is submitted, it actually means
> > submitting the
> > > > outerform, but only the fieds from inner form will be
> > validated and
> > > > updated.
> > > >
> > > > -Matej
> > > >
> > > > Korbinian Bachl wrote:
> > > > > Emm, Martinj,
> > > > >
> > > > > im not sure but as far as I know, nested forms are not
> > allowed in
> > > > > HTML3, 4 and XHTML 1.0 and 1.1. Furthermore, as its not allowed
> > > > > you dont know what the browser will do.
> > > > >
> > > > > Regards
> > > > >
> > > > >> -----Ursprüngliche Nachricht-----
> > > > >> Von: Martijn Dashorst [mailto:martijn.dashorst@gmail.com]
> > > > >> Gesendet: Samstag, 4. November 2006 17:49
> > > > >> An: Wicket Development
> > > > >> Betreff: Nested forms
> > > > >>
> > > > >> I was surprised to see the nested forms working, but I have a
> > > > >> question on what happens with the inner form inputs when the
> > > > >> outer form is
> > > > >> submitted:
> > > > >>
> > > > >> <form wicket:id="outer">
> > > > >>     <input type="text" wicket:id="field" />
> > > > >>     <form wicket:id="inner">
> > > > >>         <input type="text" wicket:id="field" />
> > > > >>         <input type="submit" wicket:id="innerSave" />
> > > > >>     </form>
> > > > >>     <input type="submit" wicket:id="outerSave" /> </form>
> > > > >>
> > > > >> public class MyPage extends WebPage {
> > > > >>     private String inner;
> > > > >>     private String outer;
> > > > >>
> > > > >>     public MyPage() {
> > > > >>         Form outer = new Form(this, "outer");
> > > > >>         new TextField(outer, "field", new PropertyModel(this,
> > > > >> "outer"));
> > > > >>         Form inner = new Form(outer, "inner");
> > > > >>         new TextField(inner, "field", new PropertyModel(this,
> > > > >> "inner"));
> > > > >>         new Button(outer, "outerSave") {};
> > > > >>         new Button(inner, "innerSave") {};
> > > > >>     }
> > > > >> }
> > > > >>
> > > > >> If the user clicks the inner button, only the inner fields are
> > > > >> processed.
> > > > >>
> > > > >> If the user clicks the outer button, both the inner and
> > > > outer fields
> > > > >> are processed, but the inner forms 'onSubmit' is not called.
> > > > >>
> > > > >> Two questions:
> > > > >>  1. should the inner fields be processed and update
> > their models?
> > > > >>  2. should the inner onSubmit/onError be called when
> > the outer is
> > > > >> submitted?
> > > > >>
> > > > >> Martijn
> > > > >> --
> > > > >> <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>
> > > > >>
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
>
>


-- 
<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>

Re: AW: Nested forms

Posted by Paolo Di Tommaso <pa...@gmail.com>.
Maybe is off topic in this thread, but what about XForm in wicket?

http://ibm.com/developerworks/xml/library/x-xformstipmultipleforms/index.html?ca=drs-

Do plan to support it in future releases?

Bye

- Paolo


On 11/5/06, Eelco Hillenius <ee...@gmail.com> wrote:
>
> > the idea of me was that the outer form extends the inner - as this is
> closes
> > to what happens in html. So yo still can process the inner one, as is a
> > complete form, but when the outer one is processed, the inner onSubmit
> etc.
> > is overriden and therefore no other misunderstandings and errors should
> > occur. This is also closest to the html form that is coming out - the
> inner
> > one can be processed, but if you do the outer one then the inner is
> > processed too (in case of formouter extends form inner) and solely
> processed
> > in case of outer form doenst extend inner form.
> >
> > that is should be 2 seperate form is ok, if the developer wants to tread
> > them seperately, if he wants to tread them together, he may use the
> outer
> > extending the inner. Sounds quite basic and easy to me.
>
> I wouldn't like to force clients use inheritance here. I think the
> nested form use cases would more closely resemble composition and
> furthermore, I don't think forcing inheritance would solve a real
> problem here.
>
> Eelco
>

Re: AW: Nested forms

Posted by Eelco Hillenius <ee...@gmail.com>.
> the idea of me was that the outer form extends the inner - as this is closes
> to what happens in html. So yo still can process the inner one, as is a
> complete form, but when the outer one is processed, the inner onSubmit etc.
> is overriden and therefore no other misunderstandings and errors should
> occur. This is also closest to the html form that is coming out - the inner
> one can be processed, but if you do the outer one then the inner is
> processed too (in case of formouter extends form inner) and solely processed
> in case of outer form doenst extend inner form.
>
> that is should be 2 seperate form is ok, if the developer wants to tread
> them seperately, if he wants to tread them together, he may use the outer
> extending the inner. Sounds quite basic and easy to me.

I wouldn't like to force clients use inheritance here. I think the
nested form use cases would more closely resemble composition and
furthermore, I don't think forcing inheritance would solve a real
problem here.

Eelco

Re: Re: AW: Nested forms

Posted by Martijn Dashorst <ma...@gmail.com>.
I am also in the 'separate forms - separate submits' camp. It is
probably easier to call the submit for the inside form using a child
visitor than it is to circumvent it.

The reason is: encapsulation. The nested form is a separate unit of
work. And what would you do if you have 3 or 4 forms nested? Call them
all? Which one would 'win' if a setResponsePage() was done?

Martijn

On 11/5/06, Matej Knopp <ma...@knopp.sk> wrote:
> Well, nothing is carved into stone. If more people think that the forms
> should be treated as separate, so be it.
>
> Do you think there should be a vote? If so can someone formulate one?
>
> -Matej
>
> Johan Compagner wrote:
> > hmm, i don't know.
> > its a difficult one.
> >
> > I think they are really separate you could implement it this way that
> > really
> > only the form is submitted.
> >
> > For example i have a Search Form component that is in my outer form.
> > and that form has really standalone behavior. if you fill in the field and
> > press search then something is searched for
> > But the outer form is editing data  so if i submit that form i really don't
> > want to search.
> >
> > That kind of example make me choose for only call the submit of the form
> > that is really submitted
> > if it is outer or inner..
> >
> > johan
> >
> >
> >
> > On 11/4/06, Matej Knopp <ma...@knopp.sk> wrote:
> >>
> >> Johan Compagner wrote:
> >> > what do you mean extend the inner form? as in java extend?
> >> > Why should you do that as developer. then just have one form. What does
> >> > that
> >> > inner do then?
> >> >
> >> > It should be just 2 seperate forms (on the java side)
> >> > and if possible we should know what button (so what form) is submitted
> >> so
> >> > that only one is processed
> >> > The other should keep the rawinput for the next render.
> >> Yeah. This is basically what currently happens. The question is, when
> >> outer form is submitted, what should the nested form do. I personally
> >> think that it should be processed to. There is a parent-child
> >> relationship, they are not isolated.
> >>
> >> If you have form a, and then form b and c inside a, you submit b, the
> >> form c should not be processed (though rawinput should be kept).
> >>
> >> But if you submit a, I think that both b and c should be processed.
> >>
> >> -Matej
> >> >
> >> > johan
> >> >
> >> >
> >> > On 11/4/06, Korbinian Bachl <ko...@whiskyworld.de> wrote:
> >> >>
> >> >> hmm.. I like that idea. If this is a wicket only thing, you might want
> >> to
> >> >> let the programmer decide what should be  happening.. perhaps the
> >> outer
> >> >> form
> >> >> has to extend the inner one if it should be  act like 1 big form, if
> >> you
> >> >> dont extend it, they are acting as 2 own forms instead?
> >> >>
> >> >> Regards
> >> >>
> >> >> > -----Ursprüngliche Nachricht-----
> >> >> > Von: Matej Knopp [mailto:matej@knopp.sk]
> >> >> > Gesendet: Samstag, 4. November 2006 18:38
> >> >> > An: wicket-dev@incubator.apache.org
> >> >> > Betreff: Re: AW: Nested forms
> >> >> >
> >> >> > Indeed, nesting html forms it not allowed. Therefore we have
> >> >> > nested forms support in 2.0. If you nest form copmonents, the
> >> >> > inner <form tags will be replaced by <div>s.
> >> >> >
> >> >> > When the inner form is submitted, it actually means
> >> >> > submitting the outerform, but only the fieds from inner form
> >> >> > will be validated and updated.
> >> >> >
> >> >> > -Matej
> >> >> >
> >> >> > Korbinian Bachl wrote:
> >> >> > > Emm, Martinj,
> >> >> > >
> >> >> > > im not sure but as far as I know, nested forms are not allowed in
> >> >> > > HTML3, 4 and XHTML 1.0 and 1.1. Furthermore, as its not allowed
> >> you
> >> >> > > dont know what the browser will do.
> >> >> > >
> >> >> > > Regards
> >> >> > >
> >> >> > >> -----Ursprüngliche Nachricht-----
> >> >> > >> Von: Martijn Dashorst [mailto:martijn.dashorst@gmail.com]
> >> >> > >> Gesendet: Samstag, 4. November 2006 17:49
> >> >> > >> An: Wicket Development
> >> >> > >> Betreff: Nested forms
> >> >> > >>
> >> >> > >> I was surprised to see the nested forms working, but I have a
> >> >> > >> question on what happens with the inner form inputs when the
> >> outer
> >> >> > >> form is
> >> >> > >> submitted:
> >> >> > >>
> >> >> > >> <form wicket:id="outer">
> >> >> > >>     <input type="text" wicket:id="field" />
> >> >> > >>     <form wicket:id="inner">
> >> >> > >>         <input type="text" wicket:id="field" />
> >> >> > >>         <input type="submit" wicket:id="innerSave" />
> >> >> > >>     </form>
> >> >> > >>     <input type="submit" wicket:id="outerSave" /> </form>
> >> >> > >>
> >> >> > >> public class MyPage extends WebPage {
> >> >> > >>     private String inner;
> >> >> > >>     private String outer;
> >> >> > >>
> >> >> > >>     public MyPage() {
> >> >> > >>         Form outer = new Form(this, "outer");
> >> >> > >>         new TextField(outer, "field", new PropertyModel(this,
> >> >> > >> "outer"));
> >> >> > >>         Form inner = new Form(outer, "inner");
> >> >> > >>         new TextField(inner, "field", new PropertyModel(this,
> >> >> > >> "inner"));
> >> >> > >>         new Button(outer, "outerSave") {};
> >> >> > >>         new Button(inner, "innerSave") {};
> >> >> > >>     }
> >> >> > >> }
> >> >> > >>
> >> >> > >> If the user clicks the inner button, only the inner fields are
> >> >> > >> processed.
> >> >> > >>
> >> >> > >> If the user clicks the outer button, both the inner and
> >> >> > outer fields
> >> >> > >> are processed, but the inner forms 'onSubmit' is not called.
> >> >> > >>
> >> >> > >> Two questions:
> >> >> > >>  1. should the inner fields be processed and update their models?
> >> >> > >>  2. should the inner onSubmit/onError be called when the outer is
> >> >> > >> submitted?
> >> >> > >>
> >> >> > >> Martijn
> >> >> > >> --
> >> >> > >> <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>
> >> >> > >>
> >> >> > >
> >> >> > >
> >> >> >
> >> >> >
> >> >>
> >> >>
> >> >
> >>
> >>
> >
>
>


-- 
<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>

Re: AW: Nested forms

Posted by Matej Knopp <ma...@knopp.sk>.
Well, nothing is carved into stone. If more people think that the forms 
should be treated as separate, so be it.

Do you think there should be a vote? If so can someone formulate one?

-Matej

Johan Compagner wrote:
> hmm, i don't know.
> its a difficult one.
> 
> I think they are really separate you could implement it this way that 
> really
> only the form is submitted.
> 
> For example i have a Search Form component that is in my outer form.
> and that form has really standalone behavior. if you fill in the field and
> press search then something is searched for
> But the outer form is editing data  so if i submit that form i really don't
> want to search.
> 
> That kind of example make me choose for only call the submit of the form
> that is really submitted
> if it is outer or inner..
> 
> johan
> 
> 
> 
> On 11/4/06, Matej Knopp <ma...@knopp.sk> wrote:
>>
>> Johan Compagner wrote:
>> > what do you mean extend the inner form? as in java extend?
>> > Why should you do that as developer. then just have one form. What does
>> > that
>> > inner do then?
>> >
>> > It should be just 2 seperate forms (on the java side)
>> > and if possible we should know what button (so what form) is submitted
>> so
>> > that only one is processed
>> > The other should keep the rawinput for the next render.
>> Yeah. This is basically what currently happens. The question is, when
>> outer form is submitted, what should the nested form do. I personally
>> think that it should be processed to. There is a parent-child
>> relationship, they are not isolated.
>>
>> If you have form a, and then form b and c inside a, you submit b, the
>> form c should not be processed (though rawinput should be kept).
>>
>> But if you submit a, I think that both b and c should be processed.
>>
>> -Matej
>> >
>> > johan
>> >
>> >
>> > On 11/4/06, Korbinian Bachl <ko...@whiskyworld.de> wrote:
>> >>
>> >> hmm.. I like that idea. If this is a wicket only thing, you might want
>> to
>> >> let the programmer decide what should be  happening.. perhaps the 
>> outer
>> >> form
>> >> has to extend the inner one if it should be  act like 1 big form, if
>> you
>> >> dont extend it, they are acting as 2 own forms instead?
>> >>
>> >> Regards
>> >>
>> >> > -----Ursprüngliche Nachricht-----
>> >> > Von: Matej Knopp [mailto:matej@knopp.sk]
>> >> > Gesendet: Samstag, 4. November 2006 18:38
>> >> > An: wicket-dev@incubator.apache.org
>> >> > Betreff: Re: AW: Nested forms
>> >> >
>> >> > Indeed, nesting html forms it not allowed. Therefore we have
>> >> > nested forms support in 2.0. If you nest form copmonents, the
>> >> > inner <form tags will be replaced by <div>s.
>> >> >
>> >> > When the inner form is submitted, it actually means
>> >> > submitting the outerform, but only the fieds from inner form
>> >> > will be validated and updated.
>> >> >
>> >> > -Matej
>> >> >
>> >> > Korbinian Bachl wrote:
>> >> > > Emm, Martinj,
>> >> > >
>> >> > > im not sure but as far as I know, nested forms are not allowed in
>> >> > > HTML3, 4 and XHTML 1.0 and 1.1. Furthermore, as its not allowed 
>> you
>> >> > > dont know what the browser will do.
>> >> > >
>> >> > > Regards
>> >> > >
>> >> > >> -----Ursprüngliche Nachricht-----
>> >> > >> Von: Martijn Dashorst [mailto:martijn.dashorst@gmail.com]
>> >> > >> Gesendet: Samstag, 4. November 2006 17:49
>> >> > >> An: Wicket Development
>> >> > >> Betreff: Nested forms
>> >> > >>
>> >> > >> I was surprised to see the nested forms working, but I have a
>> >> > >> question on what happens with the inner form inputs when the 
>> outer
>> >> > >> form is
>> >> > >> submitted:
>> >> > >>
>> >> > >> <form wicket:id="outer">
>> >> > >>     <input type="text" wicket:id="field" />
>> >> > >>     <form wicket:id="inner">
>> >> > >>         <input type="text" wicket:id="field" />
>> >> > >>         <input type="submit" wicket:id="innerSave" />
>> >> > >>     </form>
>> >> > >>     <input type="submit" wicket:id="outerSave" /> </form>
>> >> > >>
>> >> > >> public class MyPage extends WebPage {
>> >> > >>     private String inner;
>> >> > >>     private String outer;
>> >> > >>
>> >> > >>     public MyPage() {
>> >> > >>         Form outer = new Form(this, "outer");
>> >> > >>         new TextField(outer, "field", new PropertyModel(this,
>> >> > >> "outer"));
>> >> > >>         Form inner = new Form(outer, "inner");
>> >> > >>         new TextField(inner, "field", new PropertyModel(this,
>> >> > >> "inner"));
>> >> > >>         new Button(outer, "outerSave") {};
>> >> > >>         new Button(inner, "innerSave") {};
>> >> > >>     }
>> >> > >> }
>> >> > >>
>> >> > >> If the user clicks the inner button, only the inner fields are
>> >> > >> processed.
>> >> > >>
>> >> > >> If the user clicks the outer button, both the inner and
>> >> > outer fields
>> >> > >> are processed, but the inner forms 'onSubmit' is not called.
>> >> > >>
>> >> > >> Two questions:
>> >> > >>  1. should the inner fields be processed and update their models?
>> >> > >>  2. should the inner onSubmit/onError be called when the outer is
>> >> > >> submitted?
>> >> > >>
>> >> > >> Martijn
>> >> > >> --
>> >> > >> <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>
>> >> > >>
>> >> > >
>> >> > >
>> >> >
>> >> >
>> >>
>> >>
>> >
>>
>>
> 


Re: AW: Nested forms

Posted by Johan Compagner <jc...@gmail.com>.
hmm, i don't know.
its a difficult one.

I think they are really separate you could implement it this way that really
only the form is submitted.

For example i have a Search Form component that is in my outer form.
and that form has really standalone behavior. if you fill in the field and
press search then something is searched for
But the outer form is editing data  so if i submit that form i really don't
want to search.

That kind of example make me choose for only call the submit of the form
that is really submitted
if it is outer or inner..

johan



On 11/4/06, Matej Knopp <ma...@knopp.sk> wrote:
>
> Johan Compagner wrote:
> > what do you mean extend the inner form? as in java extend?
> > Why should you do that as developer. then just have one form. What does
> > that
> > inner do then?
> >
> > It should be just 2 seperate forms (on the java side)
> > and if possible we should know what button (so what form) is submitted
> so
> > that only one is processed
> > The other should keep the rawinput for the next render.
> Yeah. This is basically what currently happens. The question is, when
> outer form is submitted, what should the nested form do. I personally
> think that it should be processed to. There is a parent-child
> relationship, they are not isolated.
>
> If you have form a, and then form b and c inside a, you submit b, the
> form c should not be processed (though rawinput should be kept).
>
> But if you submit a, I think that both b and c should be processed.
>
> -Matej
> >
> > johan
> >
> >
> > On 11/4/06, Korbinian Bachl <ko...@whiskyworld.de> wrote:
> >>
> >> hmm.. I like that idea. If this is a wicket only thing, you might want
> to
> >> let the programmer decide what should be  happening.. perhaps the outer
> >> form
> >> has to extend the inner one if it should be  act like 1 big form, if
> you
> >> dont extend it, they are acting as 2 own forms instead?
> >>
> >> Regards
> >>
> >> > -----Ursprüngliche Nachricht-----
> >> > Von: Matej Knopp [mailto:matej@knopp.sk]
> >> > Gesendet: Samstag, 4. November 2006 18:38
> >> > An: wicket-dev@incubator.apache.org
> >> > Betreff: Re: AW: Nested forms
> >> >
> >> > Indeed, nesting html forms it not allowed. Therefore we have
> >> > nested forms support in 2.0. If you nest form copmonents, the
> >> > inner <form tags will be replaced by <div>s.
> >> >
> >> > When the inner form is submitted, it actually means
> >> > submitting the outerform, but only the fieds from inner form
> >> > will be validated and updated.
> >> >
> >> > -Matej
> >> >
> >> > Korbinian Bachl wrote:
> >> > > Emm, Martinj,
> >> > >
> >> > > im not sure but as far as I know, nested forms are not allowed in
> >> > > HTML3, 4 and XHTML 1.0 and 1.1. Furthermore, as its not allowed you
> >> > > dont know what the browser will do.
> >> > >
> >> > > Regards
> >> > >
> >> > >> -----Ursprüngliche Nachricht-----
> >> > >> Von: Martijn Dashorst [mailto:martijn.dashorst@gmail.com]
> >> > >> Gesendet: Samstag, 4. November 2006 17:49
> >> > >> An: Wicket Development
> >> > >> Betreff: Nested forms
> >> > >>
> >> > >> I was surprised to see the nested forms working, but I have a
> >> > >> question on what happens with the inner form inputs when the outer
> >> > >> form is
> >> > >> submitted:
> >> > >>
> >> > >> <form wicket:id="outer">
> >> > >>     <input type="text" wicket:id="field" />
> >> > >>     <form wicket:id="inner">
> >> > >>         <input type="text" wicket:id="field" />
> >> > >>         <input type="submit" wicket:id="innerSave" />
> >> > >>     </form>
> >> > >>     <input type="submit" wicket:id="outerSave" /> </form>
> >> > >>
> >> > >> public class MyPage extends WebPage {
> >> > >>     private String inner;
> >> > >>     private String outer;
> >> > >>
> >> > >>     public MyPage() {
> >> > >>         Form outer = new Form(this, "outer");
> >> > >>         new TextField(outer, "field", new PropertyModel(this,
> >> > >> "outer"));
> >> > >>         Form inner = new Form(outer, "inner");
> >> > >>         new TextField(inner, "field", new PropertyModel(this,
> >> > >> "inner"));
> >> > >>         new Button(outer, "outerSave") {};
> >> > >>         new Button(inner, "innerSave") {};
> >> > >>     }
> >> > >> }
> >> > >>
> >> > >> If the user clicks the inner button, only the inner fields are
> >> > >> processed.
> >> > >>
> >> > >> If the user clicks the outer button, both the inner and
> >> > outer fields
> >> > >> are processed, but the inner forms 'onSubmit' is not called.
> >> > >>
> >> > >> Two questions:
> >> > >>  1. should the inner fields be processed and update their models?
> >> > >>  2. should the inner onSubmit/onError be called when the outer is
> >> > >> submitted?
> >> > >>
> >> > >> Martijn
> >> > >> --
> >> > >> <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>
> >> > >>
> >> > >
> >> > >
> >> >
> >> >
> >>
> >>
> >
>
>

Re: AW: Nested forms

Posted by Matej Knopp <ma...@knopp.sk>.
Johan Compagner wrote:
> what do you mean extend the inner form? as in java extend?
> Why should you do that as developer. then just have one form. What does 
> that
> inner do then?
> 
> It should be just 2 seperate forms (on the java side)
> and if possible we should know what button (so what form) is submitted so
> that only one is processed
> The other should keep the rawinput for the next render.
Yeah. This is basically what currently happens. The question is, when 
outer form is submitted, what should the nested form do. I personally 
think that it should be processed to. There is a parent-child 
relationship, they are not isolated.

If you have form a, and then form b and c inside a, you submit b, the 
form c should not be processed (though rawinput should be kept).

But if you submit a, I think that both b and c should be processed.

-Matej
> 
> johan
> 
> 
> On 11/4/06, Korbinian Bachl <ko...@whiskyworld.de> wrote:
>>
>> hmm.. I like that idea. If this is a wicket only thing, you might want to
>> let the programmer decide what should be  happening.. perhaps the outer
>> form
>> has to extend the inner one if it should be  act like 1 big form, if you
>> dont extend it, they are acting as 2 own forms instead?
>>
>> Regards
>>
>> > -----Ursprüngliche Nachricht-----
>> > Von: Matej Knopp [mailto:matej@knopp.sk]
>> > Gesendet: Samstag, 4. November 2006 18:38
>> > An: wicket-dev@incubator.apache.org
>> > Betreff: Re: AW: Nested forms
>> >
>> > Indeed, nesting html forms it not allowed. Therefore we have
>> > nested forms support in 2.0. If you nest form copmonents, the
>> > inner <form tags will be replaced by <div>s.
>> >
>> > When the inner form is submitted, it actually means
>> > submitting the outerform, but only the fieds from inner form
>> > will be validated and updated.
>> >
>> > -Matej
>> >
>> > Korbinian Bachl wrote:
>> > > Emm, Martinj,
>> > >
>> > > im not sure but as far as I know, nested forms are not allowed in
>> > > HTML3, 4 and XHTML 1.0 and 1.1. Furthermore, as its not allowed you
>> > > dont know what the browser will do.
>> > >
>> > > Regards
>> > >
>> > >> -----Ursprüngliche Nachricht-----
>> > >> Von: Martijn Dashorst [mailto:martijn.dashorst@gmail.com]
>> > >> Gesendet: Samstag, 4. November 2006 17:49
>> > >> An: Wicket Development
>> > >> Betreff: Nested forms
>> > >>
>> > >> I was surprised to see the nested forms working, but I have a
>> > >> question on what happens with the inner form inputs when the outer
>> > >> form is
>> > >> submitted:
>> > >>
>> > >> <form wicket:id="outer">
>> > >>     <input type="text" wicket:id="field" />
>> > >>     <form wicket:id="inner">
>> > >>         <input type="text" wicket:id="field" />
>> > >>         <input type="submit" wicket:id="innerSave" />
>> > >>     </form>
>> > >>     <input type="submit" wicket:id="outerSave" /> </form>
>> > >>
>> > >> public class MyPage extends WebPage {
>> > >>     private String inner;
>> > >>     private String outer;
>> > >>
>> > >>     public MyPage() {
>> > >>         Form outer = new Form(this, "outer");
>> > >>         new TextField(outer, "field", new PropertyModel(this,
>> > >> "outer"));
>> > >>         Form inner = new Form(outer, "inner");
>> > >>         new TextField(inner, "field", new PropertyModel(this,
>> > >> "inner"));
>> > >>         new Button(outer, "outerSave") {};
>> > >>         new Button(inner, "innerSave") {};
>> > >>     }
>> > >> }
>> > >>
>> > >> If the user clicks the inner button, only the inner fields are
>> > >> processed.
>> > >>
>> > >> If the user clicks the outer button, both the inner and
>> > outer fields
>> > >> are processed, but the inner forms 'onSubmit' is not called.
>> > >>
>> > >> Two questions:
>> > >>  1. should the inner fields be processed and update their models?
>> > >>  2. should the inner onSubmit/onError be called when the outer is
>> > >> submitted?
>> > >>
>> > >> Martijn
>> > >> --
>> > >> <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>
>> > >>
>> > >
>> > >
>> >
>> >
>>
>>
> 


AW: AW: Nested forms

Posted by Korbinian Bachl <ko...@whiskyworld.de>.
Hi Johan,

the idea of me was that the outer form extends the inner - as this is closes
to what happens in html. So yo still can process the inner one, as is a
complete form, but when the outer one is processed, the inner onSubmit etc.
is overriden and therefore no other misunderstandings and errors should
occur. This is also closest to the html form that is coming out - the inner
one can be processed, but if you do the outer one then the inner is
processed too (in case of formouter extends form inner) and solely processed
in case of outer form doenst extend inner form.

that is should be 2 seperate form is ok, if the developer wants to tread
them seperately, if he wants to tread them together, he may use the outer
extending the inner. Sounds quite basic and easy to me.

Regards

Korbinian


> -----Ursprüngliche Nachricht-----
> Von: Johan Compagner [mailto:jcompagner@gmail.com] 
> Gesendet: Samstag, 4. November 2006 23:02
> An: wicket-dev@incubator.apache.org
> Betreff: Re: AW: Nested forms
> 
> what do you mean extend the inner form? as in java extend?
> Why should you do that as developer. then just have one form. 
> What does that inner do then?
> 
> It should be just 2 seperate forms (on the java side) and if 
> possible we should know what button (so what form) is 
> submitted so that only one is processed The other should keep 
> the rawinput for the next render.
> 
> johan
> 
> 
> On 11/4/06, Korbinian Bachl <ko...@whiskyworld.de> wrote:
> >
> > hmm.. I like that idea. If this is a wicket only thing, you 
> might want 
> > to let the programmer decide what should be  happening.. 
> perhaps the 
> > outer form has to extend the inner one if it should be  act 
> like 1 big 
> > form, if you dont extend it, they are acting as 2 own forms instead?
> >
> > Regards
> >
> > > -----Ursprüngliche Nachricht-----
> > > Von: Matej Knopp [mailto:matej@knopp.sk]
> > > Gesendet: Samstag, 4. November 2006 18:38
> > > An: wicket-dev@incubator.apache.org
> > > Betreff: Re: AW: Nested forms
> > >
> > > Indeed, nesting html forms it not allowed. Therefore we 
> have nested 
> > > forms support in 2.0. If you nest form copmonents, the 
> inner <form 
> > > tags will be replaced by <div>s.
> > >
> > > When the inner form is submitted, it actually means 
> submitting the 
> > > outerform, but only the fieds from inner form will be 
> validated and 
> > > updated.
> > >
> > > -Matej
> > >
> > > Korbinian Bachl wrote:
> > > > Emm, Martinj,
> > > >
> > > > im not sure but as far as I know, nested forms are not 
> allowed in 
> > > > HTML3, 4 and XHTML 1.0 and 1.1. Furthermore, as its not allowed 
> > > > you dont know what the browser will do.
> > > >
> > > > Regards
> > > >
> > > >> -----Ursprüngliche Nachricht-----
> > > >> Von: Martijn Dashorst [mailto:martijn.dashorst@gmail.com]
> > > >> Gesendet: Samstag, 4. November 2006 17:49
> > > >> An: Wicket Development
> > > >> Betreff: Nested forms
> > > >>
> > > >> I was surprised to see the nested forms working, but I have a 
> > > >> question on what happens with the inner form inputs when the 
> > > >> outer form is
> > > >> submitted:
> > > >>
> > > >> <form wicket:id="outer">
> > > >>     <input type="text" wicket:id="field" />
> > > >>     <form wicket:id="inner">
> > > >>         <input type="text" wicket:id="field" />
> > > >>         <input type="submit" wicket:id="innerSave" />
> > > >>     </form>
> > > >>     <input type="submit" wicket:id="outerSave" /> </form>
> > > >>
> > > >> public class MyPage extends WebPage {
> > > >>     private String inner;
> > > >>     private String outer;
> > > >>
> > > >>     public MyPage() {
> > > >>         Form outer = new Form(this, "outer");
> > > >>         new TextField(outer, "field", new PropertyModel(this, 
> > > >> "outer"));
> > > >>         Form inner = new Form(outer, "inner");
> > > >>         new TextField(inner, "field", new PropertyModel(this, 
> > > >> "inner"));
> > > >>         new Button(outer, "outerSave") {};
> > > >>         new Button(inner, "innerSave") {};
> > > >>     }
> > > >> }
> > > >>
> > > >> If the user clicks the inner button, only the inner fields are 
> > > >> processed.
> > > >>
> > > >> If the user clicks the outer button, both the inner and
> > > outer fields
> > > >> are processed, but the inner forms 'onSubmit' is not called.
> > > >>
> > > >> Two questions:
> > > >>  1. should the inner fields be processed and update 
> their models?
> > > >>  2. should the inner onSubmit/onError be called when 
> the outer is 
> > > >> submitted?
> > > >>
> > > >> Martijn
> > > >> --
> > > >> <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>
> > > >>
> > > >
> > > >
> > >
> > >
> >
> >
> 


Re: AW: Nested forms

Posted by Johan Compagner <jc...@gmail.com>.
what do you mean extend the inner form? as in java extend?
Why should you do that as developer. then just have one form. What does that
inner do then?

It should be just 2 seperate forms (on the java side)
and if possible we should know what button (so what form) is submitted so
that only one is processed
The other should keep the rawinput for the next render.

johan


On 11/4/06, Korbinian Bachl <ko...@whiskyworld.de> wrote:
>
> hmm.. I like that idea. If this is a wicket only thing, you might want to
> let the programmer decide what should be  happening.. perhaps the outer
> form
> has to extend the inner one if it should be  act like 1 big form, if you
> dont extend it, they are acting as 2 own forms instead?
>
> Regards
>
> > -----Ursprüngliche Nachricht-----
> > Von: Matej Knopp [mailto:matej@knopp.sk]
> > Gesendet: Samstag, 4. November 2006 18:38
> > An: wicket-dev@incubator.apache.org
> > Betreff: Re: AW: Nested forms
> >
> > Indeed, nesting html forms it not allowed. Therefore we have
> > nested forms support in 2.0. If you nest form copmonents, the
> > inner <form tags will be replaced by <div>s.
> >
> > When the inner form is submitted, it actually means
> > submitting the outerform, but only the fieds from inner form
> > will be validated and updated.
> >
> > -Matej
> >
> > Korbinian Bachl wrote:
> > > Emm, Martinj,
> > >
> > > im not sure but as far as I know, nested forms are not allowed in
> > > HTML3, 4 and XHTML 1.0 and 1.1. Furthermore, as its not allowed you
> > > dont know what the browser will do.
> > >
> > > Regards
> > >
> > >> -----Ursprüngliche Nachricht-----
> > >> Von: Martijn Dashorst [mailto:martijn.dashorst@gmail.com]
> > >> Gesendet: Samstag, 4. November 2006 17:49
> > >> An: Wicket Development
> > >> Betreff: Nested forms
> > >>
> > >> I was surprised to see the nested forms working, but I have a
> > >> question on what happens with the inner form inputs when the outer
> > >> form is
> > >> submitted:
> > >>
> > >> <form wicket:id="outer">
> > >>     <input type="text" wicket:id="field" />
> > >>     <form wicket:id="inner">
> > >>         <input type="text" wicket:id="field" />
> > >>         <input type="submit" wicket:id="innerSave" />
> > >>     </form>
> > >>     <input type="submit" wicket:id="outerSave" /> </form>
> > >>
> > >> public class MyPage extends WebPage {
> > >>     private String inner;
> > >>     private String outer;
> > >>
> > >>     public MyPage() {
> > >>         Form outer = new Form(this, "outer");
> > >>         new TextField(outer, "field", new PropertyModel(this,
> > >> "outer"));
> > >>         Form inner = new Form(outer, "inner");
> > >>         new TextField(inner, "field", new PropertyModel(this,
> > >> "inner"));
> > >>         new Button(outer, "outerSave") {};
> > >>         new Button(inner, "innerSave") {};
> > >>     }
> > >> }
> > >>
> > >> If the user clicks the inner button, only the inner fields are
> > >> processed.
> > >>
> > >> If the user clicks the outer button, both the inner and
> > outer fields
> > >> are processed, but the inner forms 'onSubmit' is not called.
> > >>
> > >> Two questions:
> > >>  1. should the inner fields be processed and update their models?
> > >>  2. should the inner onSubmit/onError be called when the outer is
> > >> submitted?
> > >>
> > >> Martijn
> > >> --
> > >> <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>
> > >>
> > >
> > >
> >
> >
>
>

AW: AW: Nested forms

Posted by Korbinian Bachl <ko...@whiskyworld.de>.
hmm.. I like that idea. If this is a wicket only thing, you might want to
let the programmer decide what should be  happening.. perhaps the outer form
has to extend the inner one if it should be  act like 1 big form, if you
dont extend it, they are acting as 2 own forms instead?

Regards

> -----Ursprüngliche Nachricht-----
> Von: Matej Knopp [mailto:matej@knopp.sk] 
> Gesendet: Samstag, 4. November 2006 18:38
> An: wicket-dev@incubator.apache.org
> Betreff: Re: AW: Nested forms
> 
> Indeed, nesting html forms it not allowed. Therefore we have 
> nested forms support in 2.0. If you nest form copmonents, the 
> inner <form tags will be replaced by <div>s.
> 
> When the inner form is submitted, it actually means 
> submitting the outerform, but only the fieds from inner form 
> will be validated and updated.
> 
> -Matej
> 
> Korbinian Bachl wrote:
> > Emm, Martinj,
> > 
> > im not sure but as far as I know, nested forms are not allowed in 
> > HTML3, 4 and XHTML 1.0 and 1.1. Furthermore, as its not allowed you 
> > dont know what the browser will do.
> > 
> > Regards
> > 
> >> -----Ursprüngliche Nachricht-----
> >> Von: Martijn Dashorst [mailto:martijn.dashorst@gmail.com]
> >> Gesendet: Samstag, 4. November 2006 17:49
> >> An: Wicket Development
> >> Betreff: Nested forms
> >>
> >> I was surprised to see the nested forms working, but I have a 
> >> question on what happens with the inner form inputs when the outer 
> >> form is
> >> submitted:
> >>
> >> <form wicket:id="outer">
> >>     <input type="text" wicket:id="field" />
> >>     <form wicket:id="inner">
> >>         <input type="text" wicket:id="field" />
> >>         <input type="submit" wicket:id="innerSave" />
> >>     </form>
> >>     <input type="submit" wicket:id="outerSave" /> </form>
> >>
> >> public class MyPage extends WebPage {
> >>     private String inner;
> >>     private String outer;
> >>
> >>     public MyPage() {
> >>         Form outer = new Form(this, "outer");
> >>         new TextField(outer, "field", new PropertyModel(this, 
> >> "outer"));
> >>         Form inner = new Form(outer, "inner");
> >>         new TextField(inner, "field", new PropertyModel(this, 
> >> "inner"));
> >>         new Button(outer, "outerSave") {};
> >>         new Button(inner, "innerSave") {};
> >>     }
> >> }
> >>
> >> If the user clicks the inner button, only the inner fields are 
> >> processed.
> >>
> >> If the user clicks the outer button, both the inner and 
> outer fields 
> >> are processed, but the inner forms 'onSubmit' is not called.
> >>
> >> Two questions:
> >>  1. should the inner fields be processed and update their models?
> >>  2. should the inner onSubmit/onError be called when the outer is 
> >> submitted?
> >>
> >> Martijn
> >> --
> >> <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>
> >>
> > 
> > 
> 
> 


Re: AW: Nested forms

Posted by Matej Knopp <ma...@knopp.sk>.
Indeed, nesting html forms it not allowed. Therefore we have nested 
forms support in 2.0. If you nest form copmonents, the inner <form tags 
will be replaced by <div>s.

When the inner form is submitted, it actually means submitting the 
outerform, but only the fieds from inner form will be validated and 
updated.

-Matej

Korbinian Bachl wrote:
> Emm, Martinj,
> 
> im not sure but as far as I know, nested forms are not allowed in HTML3, 4
> and XHTML 1.0 and 1.1. Furthermore, as its not allowed you dont know what
> the browser will do.
> 
> Regards 
> 
>> -----Ursprüngliche Nachricht-----
>> Von: Martijn Dashorst [mailto:martijn.dashorst@gmail.com] 
>> Gesendet: Samstag, 4. November 2006 17:49
>> An: Wicket Development
>> Betreff: Nested forms
>>
>> I was surprised to see the nested forms working, but I have a 
>> question on what happens with the inner form inputs when the 
>> outer form is
>> submitted:
>>
>> <form wicket:id="outer">
>>     <input type="text" wicket:id="field" />
>>     <form wicket:id="inner">
>>         <input type="text" wicket:id="field" />
>>         <input type="submit" wicket:id="innerSave" />
>>     </form>
>>     <input type="submit" wicket:id="outerSave" /> </form>
>>
>> public class MyPage extends WebPage {
>>     private String inner;
>>     private String outer;
>>
>>     public MyPage() {
>>         Form outer = new Form(this, "outer");
>>         new TextField(outer, "field", new PropertyModel(this, 
>> "outer"));
>>         Form inner = new Form(outer, "inner");
>>         new TextField(inner, "field", new PropertyModel(this, 
>> "inner"));
>>         new Button(outer, "outerSave") {};
>>         new Button(inner, "innerSave") {};
>>     }
>> }
>>
>> If the user clicks the inner button, only the inner fields 
>> are processed.
>>
>> If the user clicks the outer button, both the inner and outer 
>> fields are processed, but the inner forms 'onSubmit' is not called.
>>
>> Two questions:
>>  1. should the inner fields be processed and update their models?
>>  2. should the inner onSubmit/onError be called when the 
>> outer is submitted?
>>
>> Martijn
>> --
>> <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>
>>
> 
> 


AW: Nested forms

Posted by Korbinian Bachl <ko...@whiskyworld.de>.
Emm, Martinj,

im not sure but as far as I know, nested forms are not allowed in HTML3, 4
and XHTML 1.0 and 1.1. Furthermore, as its not allowed you dont know what
the browser will do.

Regards 

> -----Ursprüngliche Nachricht-----
> Von: Martijn Dashorst [mailto:martijn.dashorst@gmail.com] 
> Gesendet: Samstag, 4. November 2006 17:49
> An: Wicket Development
> Betreff: Nested forms
> 
> I was surprised to see the nested forms working, but I have a 
> question on what happens with the inner form inputs when the 
> outer form is
> submitted:
> 
> <form wicket:id="outer">
>     <input type="text" wicket:id="field" />
>     <form wicket:id="inner">
>         <input type="text" wicket:id="field" />
>         <input type="submit" wicket:id="innerSave" />
>     </form>
>     <input type="submit" wicket:id="outerSave" /> </form>
> 
> public class MyPage extends WebPage {
>     private String inner;
>     private String outer;
> 
>     public MyPage() {
>         Form outer = new Form(this, "outer");
>         new TextField(outer, "field", new PropertyModel(this, 
> "outer"));
>         Form inner = new Form(outer, "inner");
>         new TextField(inner, "field", new PropertyModel(this, 
> "inner"));
>         new Button(outer, "outerSave") {};
>         new Button(inner, "innerSave") {};
>     }
> }
> 
> If the user clicks the inner button, only the inner fields 
> are processed.
> 
> If the user clicks the outer button, both the inner and outer 
> fields are processed, but the inner forms 'onSubmit' is not called.
> 
> Two questions:
>  1. should the inner fields be processed and update their models?
>  2. should the inner onSubmit/onError be called when the 
> outer is submitted?
> 
> Martijn
> --
> <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>
>