I think you are right.
Using an AjaxButton it works a litle more like I want.

Nevertheless I still have a problem, because outer form submits inner form.

In my case I think that I need two separated forms, but the problem is how
to put add button y save button in the correct place. I mean, the layout is
what you mentioned but the behavior is more like two separated forms.

Thank you!

On Mon, Dec 19, 2011 at 2:04 PM, Andrea Del Bene <[email protected]>wrote:

> I think this happens because you submit your forms with a simple HTML
> "submit" button, not mapped to a Wicket component.  Try to explicitly add a
> submit component to the forms. I've added SubmitLink to both forms and
> forms are submitted as expected.
>
> HTML code:
>
> <form wicket:id="form1">
> <form wicket:id="form2">
> <input  type="submit" value="form2" wicket:id="submit2"/>
>
> </form>
>
> <input type="submit" value="form1 (outer)"  wicket:id="submit1"/>
> </form>
>
>
> Java code:
>
>  Form form1;
>    add(form1 = new Form("form1"){
>           @Override
>        protected void onSubmit() {
>            super.onSubmit();
>            System.out.println("form1");
>        }
>       });
>
>    form1.add(new SubmitLink("submit1"));
>
>        Form form2;
>        form1.add(form2 =new Form("form2"){
>           @Override
>        protected void onSubmit() {
>            super.onSubmit();
>            System.out.println("form2");
>        }
>       });
>
>    form2.add(new SubmitLink("submit2"));
>
>
>  Here I have something like a QuickStart.
>> In this reduced example I can verify this behavior. I checked that link
>> but
>> it seems to work different.
>>
>> In this case both submit button do the same. I'm using wicket 1.4.19.
>>
>>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: 
> users-unsubscribe@wicket.**apache.org<[email protected]>
> For additional commands, e-mail: [email protected]
>
>

Reply via email to