United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6817482 On IE, modal JDialog from an Applet in html frame is not modal
JDK-6817482 : On IE, modal JDialog from an Applet in html frame is not modal

Details
Type:
Bug
Submit Date:
2009-03-14
Status:
Closed
Updated Date:
2011-02-16
Project Name:
JDK
Resolved Date:
2009-08-24
Component:
deploy
OS:
windows_xp
Sub-Component:
plugin
CPU:
x86
Priority:
P2
Resolution:
Fixed
Affected Versions:
5.0u16
Fixed Versions:
5.0u21 (b01)

Related Reports
Backport:
Backport:
Backport:
Backport:
Backport:
Backport:
Relates:

Sub Tasks

Description
JRE 1.5.0_16 + IE6/7.  

If an applet in an html frame shows a JDialog created as
"new JDialog((Frame)null, true);" does not behave as a
modal dialog.  Users can move brwser window in front of
the dialog by clicking the browser window.

  <frameset name="main" cols="300,*" framespacing="0">
      <frame src="form.html" frameborder="0" marginwidth="0" />
      <frame src="control.html" frameborder="0" marginwidth="0" />
  </frameset>

// control.html
  <body topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" marginheight="0" marginwidth="0">
    <applet code="modal2.ToolApplet.class" archive="../dist/Modal2.jar" width="100%" height="100%" name="SampleForm" vspace="0" hspace="0" >
    </applet>
  </body>

This symptom is not seen on Firefox or Safari.

The symptom was seen on 6u7 as well, but with 6u12, the
dialog works as a modal dialog.

So, it looks like java plugin for IE in 1.5 and 6.0-6u7 issue.
.

                                    

Comments
EVALUATION

Following changes in OnEnableModeless() fix the issue:

              if (FAILED(hr)) {
                  spInPlaceFrame->GetWindow(&containerWindow);
+ 
+                 // With IE7 and IE8, containerWindow would be the handle of 'TabWindowClass' window
+                 // and not IEFrame window, so get the handle of it's parent.
+                 TCHAR className[64] = {0}; 
+                 ::GetClassName(containerWindow, className, 64*sizeof(TCHAR)); 
+                 if (strcmp(className, "IEFrame") != 0) {
+                   containerWindow = ::GetParent(containerWindow);
+                 }
+
                                     
2009-07-21



Hardware and Software, Engineered to Work Together