-
18 Feb 2010 8:00 AM #1
[FIXED-600] 'unloadListeners' is null or not an object
[FIXED-600] 'unloadListeners' is null or not an object
Ext version tested:
- Ext 3.1.1
Adapter used:- ext
css used:- only default ext-all.css
Browser versions tested against:- IE8
Operating System:- WinXP Pro
Description:- Unload events attached to the body element causes issues with Ext default unload behavior.
It has been noticed in a post at premium area but with no feedback from the user: unloadListeners is null or not an object?
Test Case:
Really simple to simulate. Create this html file, load on IE8 with debugging activated, and hit F5 to reload. I guess in firefox the error occurs too but it bypasses the error notification as it is on unload event.
Debugging already done:Code:<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Ext Unload Bug</title> <link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css"/> <script type="text/javascript" src="../../adapter/ext/ext-base-debug.js"></script> <script type="text/javascript" src="../../ext-all-debug.js"></script> <script type="text/javascript"> Ext.onReady(function() { Ext.EventManager.on( Ext.getBody() ,'unload' ,function() { //do something },this) }); </script> </head> <body> </body> </html>- In ext-base-all.js we can see this on _unload method: First the unloadListeners is clean, and then Ext.EventManager._unload(); is fired. Somewhere on Ext.EventManager._unload(); method chain it calls removeListener(), to remove the unload event attached by us at the body element. That's when unloadListeners is null and the error occoursCode:
unloadListeners = null; Ext.EventManager._unload();
Possible fix:- clear unloadListeners after call Ext.EventManager._unload();
-
18 Feb 2010 10:57 AM #2Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Redwood City, California
- Posts
- 3,652
- Vote Rating
- 14
Fixed in ext-core 144 - 3.1.x and 3.2.x branches.
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote