Yes, the form validates, I put the breakpoint at onSubmit and that method was invoked.
I tried it also with empty form.
The behavior is following:
when I have only AjaxLinks in the form, it is ok.
When I add AjaxButton, the behavior changes - the first time the modal window is displayed, it is possible to close the window with the cross in the upper right corner and with any AjaxLink I have in the form. But only when the first click goes to one of these elements. When I first click on the button to close the window, suddently the cross and the links became dead too.

Vitek

Matej Knopp wrote:
Are you sure your Form validates, when you click AjaxLink? Because
otherwise the onSubmit is not invoked. Can you put a breakpoint in
onSubmit? Also there is onError handler that is invoked when form
validation fails.

-Matej

On 9/14/07, Vit Rozkovec <[EMAIL PROTECTED]> wrote:
I am sorry, I could not replicate it in quickstart. The button works
fine there. For now I solved the problem by replacing AjaxButtons with
AjaxLinks.

Vitek

Matej Knopp wrote:
Plase create a jira issue and attach a quickstart to it. Thanks.

-Matej

On 9/13/07, Vit Rozkovec <[EMAIL PROTECTED]> wrote:

Good day,
I am using last snapshot of wicket and there is a problem with modal
window - I create instance of the window and add it to the page. As a
content I use a panel which has these components:

public class ModalConfirmationPanel extends Panel {

    public ModalConfirmationPanel(String id, final ModalWindow window) {
        super(id);

        window.setTitle(getString("titulek"));

        Form form = new Form("confirmation");
        add(form);
        form.add(new TextArea("explanation", new Model("")));
        form.add(new AjaxLink("ok") {
            @Override
            public void onClick(AjaxRequestTarget target) {
                window.close(target);
            }
        });
        form.add(new AjaxLink("storno") {
            @Override
            public void onClick(AjaxRequestTarget target) {
                window.close(target);
            }
        });
//        form.add(new AjaxSubmitButton("buttonOk", form) {
//            @Override
//            protected void onSubmit(AjaxRequestTarget target, Form form) {
//                window.close(target);
//            }
//        });
//        form.add(new AjaxButton("buttonStorno", form) {
//            @Override
//            protected void onSubmit(AjaxRequestTarget target, Form form) {
//                window.close(target);
//            }
//        });


When I uncomment the lines and add AjaxSubmitButtons or AjaxButtons, the
modal window cannot be closed anymore, neither with the buttons, nor
with the close button in the header or with links. When I add just
links, it works ok. It does not matter if there is window.close() method
in the button's onSubmit method.

If you would like I can make a quickstart. I cannot test anymore, but in
beta3 it worked.

Vitek

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to