Reputation: 807
i have created a wicket popup window which opens on clicking a link like below
new BookmarkablePageLink("popupLink", Popup.class)
This Popup class has a form inside it which needs to be submitted and also the popup closed . Using PopupCloseLink i can close the popup but the form does not get submitted. If i use a AjaxSubmitButton how do i close this popup in onSubmit() ? Can this be done without using ModalWindow class ?
Thanks
Upvotes: 1
Views: 1713
Reputation: 780
You could just append the javascript that PopupCloseLink adds during the onSubmit of your AjaxSubmitButton (see: PopupCloseLink$ClosePopupPage.html)
AjaxSubmitLink close = new AjaxSubmitLink("close") {
@Override
protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
super.onSubmit(target, form);
target.appendJavaScript("javascript:self.close()");
}
};
Upvotes: 2