wood burning stoves 2.0*
The moose likes Applets and the fly likes showModelessWindow() in IE restricts javascript to applet communication Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "showModelessWindow() in IE restricts javascript to applet communication" Watch "showModelessWindow() in IE restricts javascript to applet communication" New topic

showModelessWindow() in IE restricts javascript to applet communication

Robbie Knight

Joined: Sep 18, 2006
Posts: 3
Incase, the title didn't give it away, here is my scenario:

I have a main html window that pops up a dialog box using the showModelessDialog method. This method is only available in IEs javascript implementation. That's OK because the business all use IE.

the popped up dialog box contains an applet. Method calls happen as follows. user clicks on button -> javscript method is invoked -> javascript method calls applet method -> applet method churns (processes) -> applet method calls javascript method (to update certain fields) -> applet method exits -> user is happy.

However, the last applet call into the javascript fails in IE. is this a bug? When I use window.open instead of window.showModelessDialog, then the bug is not apparent.

Any Ideas?

Here is a test setup that will reproduce the problem:

main window:

popup window

Applet. (you will need to have netscape's plugin.jar in your classpath in order to run - this should be available in your java jre's lib folder)

[ UD: added linebreaks to preserve layout ]
[ September 28, 2007: Message edited by: Ulf Dittmer ]
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 41134
Welcome to JavaRanch.

Just a wild guess, but maybe LiveConnect (in the shape of the JSObject.getWindow method) doesn't consider a modeless dialog a window. There may be something missing that it needs to function.

How does the call fail - does it return a null object, or what happens?

If you can't get this to work, an alternative to JSWindow might be to use the Common DOM API, which also lets an applet manipulate the enclosing HTML page.

Ping & DNS - my free Android networking tools app
I agree. Here's the link: http://aspose.com/file-tools
subject: showModelessWindow() in IE restricts javascript to applet communication
Similar Threads
Controlling applet from html code
problem of applet in Netscape 6.2 while usinf JSObject
prolem while calling javascript method from applet in Netscape6.2
Problem while Invoking Applet's method from javascript
problem of JSObject in Netscape6.2