Hi Korbinian,
you can overwrite ModalDialog#close and do something like this.
public class MyModalDialog extends ModalDialog {
private SerializableConsumer closeWindowCallback;
...
public void
setCloseWindowCallback(SerializableConsumer
closeWindowCallback) { this.closeWindowCallback = closeWindowCallback; }
@Override public ModalDialog close(AjaxRequestTarget target) {
super.close(target); if (closeWindowCallback != null) {
closeWindowCallback.accept(target); } return this; }
...
}
I also could not find many of the features the old ModalWindow had in
ModalDialog. (for example resize, move, header, closebutton).
Hope that helps,
Johannes Renoth
On 20/10/2023 10:31, Korbinian Bachl wrote:
Hi,
when I try to migrate a ModalWindow to ModalDialog i came accross this:
add(new AjaxLink("edit") {
@Override
public void onClick(AjaxRequestTarget target) {
getModalWindow().setModel(ReferenceEditorPanel.this.getModel());
getModalWindow().setWindowClosedCallback(new
ModalWindow.WindowClosedCallback() {
public void onClose(AjaxRequestTarget target) {
target.add(ReferenceEditorPanel.this);
ReferenceEditorPanel.this.onUpdate(target);
}
});
getModalWindow().show(target);
}
});
-> What would a correct way be for the setWindowClosedCallback? Have only see
some onOk(AjaxRequestTarget) and onCancel(AjaxRequestTarget)?
Best,
KB
-
To unsubscribe, e-mail:users-unsubscr...@wicket.apache.org
For additional commands, e-mail:users-h...@wicket.apache.org