简体   繁体   中英

Passing COM and accessing components between HTML window

I have a 2 HTML pages. Page 1 has a COM component, say COMP1. How can I pass this to page 2 when I use window.ShowModelessDialogue ? I tried something like this:

window.showModelessDialog("Page2.html", COMP1, "....");

but on the Page 2 when I say window.dialogArguments it says undefined . Please help.

Found the solution. This can be as below.

 var args = { parentWindow: window };
 window.showModelessDialog("Page2.html", args,"...");

Here the Window is the parent page which contains the com component COMP1. In the page2.html add the below code to get the com component COMP1.

 if (typeof window.dialogArguments == 'object' && window.dialogArguments !== null) {
           var parentArgs = window.dialogArguments;
            if (parentArgs.parentWindow !== null) {
                        pWindow= parentArgs.parentWindow;
                        comComp = pWindow.COMP1;
          }
 }

This worked for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM