The answer should be that you use the WebDialog.close method, but that hasn't worked for me. I have tried to close my dialog from a button using two methods:
A). Used WebDialog.add_action_callback to add a callback, which in turn calls WebDialog.close on the WebDialog, and call this callback in the script behind my close button.
B). The script behind my close button uses window.close() in javascript.
Either way, only the html page within the WebDialog seems to be closed. I am left with the dialog window still sitting there, displaying a "This program cannot display the webpage" message.
Just to be clear, here is my close button code in HTML:
<input type="button" class="okcancel" value="Cancel" onclick="close_dialog();" />
Here is the javascript that button runs:
function close_dialog() {
window.location='skp_close_dialog';
}
Here is where I register my callback that closes the WebDialog (@dialog is the dialog I opened earlier):
@dialog.add_action_callback("close_dialog") {
|d,params|
@dialog.close
}
It seems like it should be pretty simple, but it just doesn't close right. If anybody out there knows why this happens, I'd appreciate hearing about it.