The problem
I have a problem trying to close a dialog box.
Details
1. Page /sites/site1/Pages/Dashboard.aspx opens a dialog box using SharePoint Modal API (SP.UI.ModalDialog.showModalDialog)
2. The dialog opens the url /sites/site1/Lists/OutputRequests/NewForm.aspx
3. K2 redirects the page to https://k2dev.idmdevnet.local/Runtime/Runtime/Form.aspx?_Name=...
When the page is successfully submitted or canceled we get "Form submitted successfully" and then the user has to manually close the dialog, which we wanted to be done automatically.
- The SharePoint APIs are not longer available since the page is not in the K2 application/domain
- window.close and window.parent.close will throw "Scripts may close only the windows that were opened by it."
- the close window rule doesn't close the dialog
Specs
K2 4.16060.2000.1
SharePoint 2013 15.0.4849.1000
Related threads
SmartForm rule action "close the browser window" leaves the browser tab open to a blank page
Close SmartForm Window
http://community.k2.com/t5/K2-blackpearl/Close-SmartForm-Window/td-p/59409
Close SharePoint 2013 Modal Dialog box with Cancel Button