Click to See Complete Forum and Search --> : Window Freezing on close


wmacey
05-30-2003, 03:35 PM
I HAVE A PROBLEM THAT IS DRIVING ME CRAZY..............


I have a logon page that, upon successful logon, opens a popup window and load the main application. The main pages of the application contain either 1,2 or 3 Java Applets which in turn contain JTables.

Upon closing the application through the Logoff feature, the popup closes and the Logon page reappears. When clicking the handy little [x] in the title bar of the browser, the application completely hangs up. I have tried as much as I can possibly think of and nothing makes any difference.

If the applets on the page are not in an editing state, everything seems to work fine, but once focus is in one of the text cells, the problem is again encountered.

Any help or ideas on direction would be greatly appreciated at this point


**************************
Logon Page -- relevant parts
**************************
<script>
var mainAppWindow;
function handleClose()
{

if (mainAppWindow)
setTimeout("relocate();", 500);
return true;
}
function relocate()
{
if (mainAppWindow)
{
if (mainAppWindow.closed)
{
document.body.focus();
location.href="Logon.jsp";
}
}
else
{
document.body.focus();
location.href="Logon.jsp";
}
}
</script>



*********************
MainAppWindow Code
*********************
<script>
function destroyApplets()
{
if (document.applets[0])
document.applets[0].destroy();
if (document.applets.length>1)
document.applets[1].destroy();
if (document.applets.length>2)
document.applets[2].destroy();
top.opener.handleClose();
return true;
}
</script>

<body onUnload="return destroyApplets();">

Warren :confused:

khalidali63
05-30-2003, 03:39 PM
seems like one or all of the applet destroy() methods are not being called,rather in process they hang the browser.I'd debug that part first and make sure all of the destroy methods are being invoked and they are closing the applet as well

wmacey
06-02-2003, 01:05 PM
I have checked that the destoy applet methods are being called, and they appear to be doing their job by disposing of all resources and closing the applets.

It just seems that the browser hangs during the process and when I check the popupWindow.closed property, the browser.javascript throws a fit because the window is hung.

Khalid Ali
06-02-2003, 01:06 PM
you have a link to this page??

Nevermore
06-02-2003, 01:09 PM
Name change, eh?

wmacey
06-02-2003, 01:16 PM
Unfortunately I have external link to this masterpiece-in-progress

wmacey
06-02-2003, 01:17 PM
I mean I have NO external link to this masterpiece-in-progress

Khalid Ali
06-02-2003, 01:20 PM
Originally posted by cijori
Name change, eh?

An some face lift and some....lypo suction..lol..and few more thingies..

wmacey
06-02-2003, 01:34 PM
By adding the two lines in bold, there is a small window that flickers on and off the screen, but everything else works fine......does this help diagnose?



function destroyApplets()
{
if (document.applets[0]) document.applets[0].destroy();
if (document.applets.length>1) document.applets[1].destroy();
if (document.applets.length>2) document.applets[2].destroy();

var temp = window.open('','blank', "top=0, left=0, width=1, height=1");
temp.close()
top.opener.handleClose();
return true;
}

Khalid Ali
06-02-2003, 01:42 PM
This is really a guess work now..( since I don't have the same environment)....

make return false.....what you have described above,that means its being called on an infinite loop...

wmacey
06-02-2003, 04:41 PM
Originally posted by Khalid Ali
This is really a guess work now..( since I don't have the same environment)....

make return false.....what you have described above,that means its being called on an infinite loop...

I have made the return value = false with no results. I am not sure I completely understand the "infinite loop" comment above.