Hi all,
I have a ModalWindow, which when closed should update a panel (in this case,
happens to be the parent of the ModalWindow) :
final ChangePasswordModal changePasswordModal = new
ChangePasswordModal("changePasswordModal", person,
InputEditCustomerSysPanel.this);
changePasswordModal.setCloseButtonCallback(new CloseButtonCallback() {
@Override
public boolean onCloseButtonClicked(AjaxRequestTarget target) {
info("close button");
target.add(InputEditCustomerSysPanel.this);
return true;
}
});
add(changePasswordModal);
This works when the close button is clicked by the user. However, the
primary use case is the modal will be closed by a an AjaxButton inside a
form inside a panel inside the modal:
AjaxButton submitBtn = new AjaxButton("submitBtn") {
@Override
protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
// info("Updating password for " +
person.getObject().getId() + " to be
" + passwordField.getModelObject().toString());
log.info("Updating password for {} to be {}",
person.getObject().getId(),
passwordField.getModelObject());
person.getObject().setPassword(LdapUtils.encodeSsha(passwordField.getModelObject()));
modalWindow.close(target); // PROBLEM: this doesn't call the
callback
above
super.onSubmit(target, form);
}
};
add(submitBtn);
Problem is, the callback is not called by onSubmit(). And I can't call the
callback manually using the ModalWindow because I can't get to the callback
object, i.e. no getCloseButtonCallback() method.
How to solve this? Thank you.
Rudi
--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/How-to-call-a-ModalWindow-s-close-callback-tp4653456.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]