/** * Shows an OK/cancel dialog. The delegate will provide contents and behavior for the OK button * (and if needed, for the cancel one as well) * * @param target * @param delegate */ public void showOkCancel(AjaxRequestTarget target, final DialogDelegate delegate) { // wire up the contents userPanel = delegate.getContents("userPanel"); window.setContent(new ContentsPage(userPanel)); // make sure close == cancel behavior wise window.setCloseButtonCallback( new ModalWindow.CloseButtonCallback() { public boolean onCloseButtonClicked(AjaxRequestTarget target) { return delegate.onCancel(target); } }); window.setWindowClosedCallback( new ModalWindow.WindowClosedCallback() { public void onClose(AjaxRequestTarget target) { delegate.onClose(target); } }); // show the window this.delegate = delegate; window.show(target); }
public boolean onCloseButtonClicked(AjaxRequestTarget target) { return delegate.onCancel(target); } });
public void onClose(AjaxRequestTarget target) { delegate.onClose(target); } });
void submit(AjaxRequestTarget target, Component contents) { if (delegate.onSubmit(target, contents)) { close(target); } }
@Override public void onClick(AjaxRequestTarget target) { if (delegate.onCancel(target)) { window.close(target); delegate = null; } }
void submit(AjaxRequestTarget target, Component contents) { if (delegate.onSubmit(target, contents)) { close(target); } }
public boolean onCloseButtonClicked(AjaxRequestTarget target) { return delegate.onCancel(target); } });
@Override protected void onError(AjaxRequestTarget target, Form<?> form) { delegate.onError(target, form); } };
@Override protected void onError(AjaxRequestTarget target, Form form) { delegate.onError(target, form); }
public void onClose(AjaxRequestTarget target) { delegate.onClose(target); } });
public Page createPage() { userPanel = delegate.getContents("userPanel"); return new ContentsPage(userPanel); } });
@Override public void onClick(AjaxRequestTarget target) { if (delegate.onCancel(target)) { window.close(target); delegate = null; } } };