Hi, Alexandru, thanks for the quick reply.

I get 

java.lang.IllegalStateException: form was not specified in the constructor and 
cannot be found in the hierarchy of the component this behavior is attached to

the form is located in the same page and displayed, but it's actually placed 
within a panel that is a child of the page. :-(

BR,

-----Original Message-----
From: Alexandru Barbat [mailto:alexandrubar...@gmail.com] 
Sent: Monday, January 18, 2010 11:26 AM
To: users@wicket.apache.org
Subject: Re: submit a form from outside of it

Hi,

Try this:

AjaxFormSubmitBehavior behave = new AjaxFormSubmitBehavior(myForm,
"onclick") {
            protected void onSubmit(AjaxRequestTarget target) {
                //do what you have to do
            }


        };


Button submitButton = new Button("submitButton");

submitButton.add(behave);

...

Alexandru

2010/1/18 Martin Asenov <mase...@velti.com>

> Hello, everyone!
>
> I have a form that has validation and so on, but the main difference to
> ordinary forms is that my form does not contain it's submit button. It's
> located in a parent, in my case a web page.
>
> I'm wondering how can I force the form submitting from the page. The code
> is
>
> submitButton = new AjaxButton("submit_button) {
>         protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
>                   myForm.processForm();
>         }
> };
>
> The method processForm() in myForm just calls process();
>
> But nothing happens, looks like I'm missing something...
>
> Thanks,
> Martin
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to