On the site that holds the ModalWindow I have something like that:

modalWindow.setContent(new modalWindowPanel(modalWindow.getContentId(), new
ModalWindow.CloseButtonCallback(){
        private static final long serialVersionUID = 4622180781771170962L;

        public boolean onCloseButtonClicked(AjaxRequestTarget target) {
                modalWindow.close(target);
                return true;
        }
                        
}));

And in the Panel that is shown in the ModalWindows I do:

form.add(new AjaxButton("ok"){
  private static final long serialVersionUID = -5005868829551738938L;
  @Override
  protected void onSubmit(AjaxRequestTarget ajaxRequestTarget, Form form) {
    ajaxRequestTarget.addComponent(this.getPage().get("Formname"));
    // this.getPage() gives the Page which holds the ModalWindow
    closeCallback.onCloseButtonClicked(ajaxRequestTarget);
  }
});

Works fine for me, hope that helps.
-- 
View this message in context: 
http://www.nabble.com/ModalWindow-%28component-based%29-%2B-form-submit-%3D-can%27t-close-tp15831226p16121382.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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

Reply via email to