I am popping up a ModalWindow with a form - which has Cancel and Submit
buttons. Unfortunately, I can't get the Cancel button to close the window.
It keeps submitting to the validator, stays on the form and echos validation
text to the feedback panel.

I can get it to work with an AjaxLink.


    <a href="#" wicket:id="cancel.link"><wicket:message
key="Application.cancelButton.label"/></a>
    <input wicket:id="cancel.button" type="button"
wicket:message="value:Application.cancelButton.label"/>



                        final AjaxLink cancelLink = new AjaxLink("cancel.link") 
{
                                private static final long serialVersionUID = 1L;

                                @Override
                                public void onClick(final AjaxRequestTarget 
target) {
                                        modal.close(target);
                                }

                        };
                        add(cancelLink);

                        final AjaxButton cancel = new 
AjaxButton("cancel.button",
AreaEditorForm.this) {
                                private static final long serialVersionUID = 1L;

                                @Override
                                protected void onSubmit(final AjaxRequestTarget 
target,
                                                final Form<?> form) {
                                        modal.close(target);
                                }
                        };
                        cancel.setDefaultFormProcessing(false);
                        add(cancel);


I thought that I could set default form processing = false but that doesn't
seem to be enough.

Thoughts?

-Luther

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Cancelling-ala-AjaxLink-vs-AjaxButton-tp2717635p2717635.html
Sent from the Users forum mailing list archive at Nabble.com.

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

Reply via email to