Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

showModelessWindow() in IE restricts javascript to applet communication

Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 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 ]
Posts: 43016
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
    Bookmark Topic Watch Topic
  • New Topic