View Full Version : [OPEN] [OPEN-EXTJSIV-1654] Initializing QuickTips on Frameset-Only page breaks

24 Apr 2011, 7:06 AM
When Initializing Quicktips in a Frameset-Only page, it breaks with the following error:

Uncaught TypeError: Cannot call method 'addCls' of null

<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<title>Frameset Ext4 Quicktip Bug Demo</title>
<link rel="stylesheet" type="text/css" href="ext4/resources/css/ext-all.css" />
<script type="text/javascript" src="ext4/bootstrap.js"></script>
<script type="text/javascript">
<frame src="about:blank" />
<frame src="about:blank" />

Using Beta3 on Iron 10.0.650, Current Firefox 4 version does the same thing. I guess it happens because we do not actually have a 'body' element in framesets.

Believe me, I don't like our frameset any more than you do, but I still have to keep it for backwards compatibility :-(

It would be great if Ext would give a proper error message when this error happens. It took me ages to figure out what exactly the problem was :)

Jacky Nguyen
2 May 2011, 3:53 PM
The issue is your HTML document does not have a body tag which the framework currently relies on. We're looking into this. Thank you for reporting.

3 May 2011, 10:32 AM
Yep, I thought it was the missing body-element creating problems there. I don't see how you can get around the frameset restrictions though. I recomment simply making Ext complain when trying to initialize quicktips without a valid body element...

Jacky Nguyen
6 May 2011, 9:39 AM
Did this ever work for you in Ext JS 3.x?

6 May 2011, 9:44 AM
I never encountered the problem in Ext JS 3.x since all the loading was done manually, and the Quicktips were only initialized within each frame manually. Now, with the new App architecture QuickTips are enabled per default and hence break when the App is created on a frameset-only page if not explicitly disabled.

Jacky Nguyen
6 May 2011, 9:54 AM
Apparently from the code you provided, Ext.tip.QuickTipManager.init() is explicitly called. If you just need to get it loaded, take out the init() call and simply use Ext.require like this:

<script type="text/javascript">

Ext.onReady(function() {

Also, don't use bootstrap.js, use ext-debug.js (and change to ext.js for production) instead

6 May 2011, 10:01 AM
Oh, thats what happens when I don't pay attention :-D

I the example I am calling it explicitly, but the problem actually occurred in our environment when loading our own Ext.app.Application, which automatically initializes quicktips if not explicitly disabled. Still, I think quicktips should check weather they actually have a body to initialize to instead of breaking with a "variable is null" error :-)

About the bootstrap.js: I would love to use ext-debug.js, but our virtual dev environments already take far too long to autoload all of our custom classes. I'll still get rid of the bootstrap.js and use ext-all-debug.js instead. If I ever figure out why networking is so slow for virtual machines here I'll give it a try :-)

9 May 2011, 12:30 PM
Thanks for the report and test code. Both have made it to the repo.