When new window is open through window.open we are not able to access the Document Complete.

Add-in Express™ Support Service
That's what is more important than anything else

When new window is open through window.open we are not able to access the Document Complete.
When new window is open through window.open we are not able to access the Document Complete. 
archana srivastava


Guest


We are working on a project to convert the html contents on Document Complete event this is working fine in case of main window. But when new window is open through window.open we are not able to access the Document Complete.

How do we access the new window contents which is opened through window.open in javascript code of client
Posted 10 Jan, 2017 11:51:31 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Archana,

Do you open a new browser window/tab or you open a web page in the same IE tab?
Posted 11 Jan, 2017 04:53:45 Top
archana srivastava


Guest


Thanks for your responce.

We are opening in new browser window through window.open in javascript
Posted 11 Jan, 2017 05:51:35 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Archana,

I guess that a new browser window is opened in a separate process. Do you use the Visual Studio debugger to check if the DocumentComplete event fires?
Posted 11 Jan, 2017 08:06:01 Top
archana srivastava


Guest


Hi,

I checked on the Visual Studio debugger DocumentComplete event is not firing.
Posted 11 Jan, 2017 09:52:47 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Archana,

Please add a message box to the DocumentComplete event handler. Then open a new browser window via window.open. The message box should be displayed when the browser windows is opened. If you want to use the Visual Studio debugger, you need to attach to the process of the new browser window.
Posted 12 Jan, 2017 07:54:28 Top
archana srivastava


Guest


documentcomplete event is not getting triggered in window.showModalDialog window
Posted 13 Jan, 2017 13:10:49 Top
archana srivastava


Guest


Dear Sergey,

Please respond soon it is urgent requirement

How can we get the DocumentComplete event fired for showmodaldialog method.
Posted 16 Jan, 2017 03:43:46 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Archana,

window.showModalDialog doesn't load IE add-ons in the modal window. That is why the DocumentComplete event doesn't work.
Please read the following articles to learn how you can access a document opened in the modal window: https://msdn.microsoft.com/en-us/library/ms533027(v=vs.85).aspx
https://www.tjvantoll.com/2012/05/02/showmodaldialog-what-it-is-and-why-you-should-never-use-it/
Posted 16 Jan, 2017 13:26:50 Top
archana srivastava


Guest


Hi Sergey

Can you please provide us a sample code to access document of showmodaldialog.
Posted 16 Jan, 2017 23:29:40 Top