3.2.0

Firefox Upgrades Today broke our ActiveWidgets

Across the Firefox suite, the recent upgrades (2.0.0.1, 1.5.0.9, et al) have broken our use of ActiveWidgets. In our case, we have an XML that we are rendering via XSLT, in which the AW is set up. When we run with 2.0.0.0 or 1.5.0.8, everything is fine. After the upgrade, we get this error:

AW.UI.Grid is not a constructor

We've tried rendering the XML to HTML via Xalan offline, and then loading the HTML . In that case, we do see the ActiveWidgets work correctly. When the rendering occurs as part of the client side XSLT transform, we get this error.

Is anyone else seeing this? Does anyone have any insight on what the underlying issue is?
Dave
December 20,
Dave,

I think this problem should be related to XSLT. So far I don't see any new issues with FF 2.0.0.1. Could you post an example of your XML and XSLT files? Or somehow check the generated HTML (possibly with Firebug or DOM inspector)?
Alex (ActiveWidgets)
December 20,
OK, we have broken this down to some minimal test cases. The code below does run, render and instantiate the empty ActiveWidgets grid in 1.5.0.8, and fail with the error I posted above on 1.5.0.9 and 2.0.0.1. Loading test.xml will throw the Javascript errors in 1.5.0.9, succeed in 1.5.0.8 .

As a little further background, the environment in which we are using this is on an SSL site that uses client side certificates for authentication, just in case that is a factor. I'll test to see if we get the same errors going through non-SSL HTTP.

test.xml
-----
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="/xsl/test.xsl"?>
<toplevel>
<item/>
</toplevel>
-----
test.xsl
-----
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<html><head class="aw-all aw-gecko aw-unix aw-linux aw-ff15"><title>Test Case -
Rendered</title>
<SCRIPT language="JavaScript" src="/test.js" />
<SCRIPT language="JavaScript" src="/runtime/lib/aw.js" />
</head>
<body>
<SCRIPT type="text/javascript">
var test = displayTest();
var grid = new AW.UI.Grid;
document.getElementById('test').innerHTML=test ;
document.getElementById('grid').innerHTML= grid;
</SCRIPT>
This is the HTML created by the XSL.
<div id="test"/>
<div id="grid" />
</body>
</html>
</xsl:template>
</xsl:stylesheet>
-----

test.js
-----
function displayTest() {
var output = "";
for (i = 1; i <= 5; i++) {
output += "This is a line from Javascript, #" + i + "<br>\n";
}
return output;

}
-----
Dave
December 21,
As a little more background, using Firebug to inspect the DOMs in 2.0.0.1 vs 1.5.0.8, in the former I would see that AW is created, AW.Grid is created, but the functions contained in it were not. Created and deferred were false for most of the internal attributes of AW.Grid. In the working version, they are all created.
Dave
December 21,
Just as a side-note, as I am very interested in seeing any results on this issue, I am not experiencing any problems so far with 1.5.0.8 and JS arrays for my grids (I have too much data to pull formatted xml, simple comma delimiters work great and only take one character as opposed to full-length attribute/node names)

Anyhow, again, updated FF works okay with JS arrays.
John Mason
December 21,
Further update: if we wrap the AW creation into a JS function and call that from onLoad(), it seems to work.

Updated test.xsl

-----
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<html><head class="aw-all aw-gecko aw-unix aw-linux aw-ff15"><title>Test Case - Rendered</title>
<SCRIPT language="JavaScript" src="/test.js" />
<SCRIPT language="JavaScript" src="/runtime/lib/aw.js" />
<link rel="stylesheet" type="text/css" href="/runtime/styles/xp/aw.css"/>

</head>
<body onLoad="createUI()">
<SCRIPT type="text/javascript">

var grid = null;
function createUI() {
var test = displayTest();
grid = new AW.UI.Grid;
grid.setColumnCount(2);
grid.setRowCount(3);
var data = [[1,"A"], [2, "B"], [3, "C"]];
var headers = ["Left", "Right"];
grid.setCellData(data);
grid.setHeaderText(headers);
document.getElementById('test').innerHTML=test ;
document.getElementById('grid').innerHTML= grid;
}
</SCRIPT>
This is the HTML created by the XSL.
<div id="test"/>
<div id="grid" />
</body>
</html>
</xsl:template>
</xsl:stylesheet>
-----
Dave
December 21,
This is a really bad Firefox bug. It looks like Firefox executes the first 3 lines of aw.js, then the script gets suspended (when it tries to access html.className attribute) and Firefox continues with the rest of the page, including other scripts. Just before onload event the remaining part of aw.js gets executed.

The workaround requires editing aw.js file. Find the following statement in aw.js, line 17 (3rd line of code), pos 911-968 -

document.getElementsByTagName("html")[0].className+=htmlc;


and replace it with

AW.htmlclasses = htmlc;


Then add the following line at the very end of aw.js -

document.getElementsByTagName("html")[0].className += AW.htmlclasses;


The problem seems to be related to client-side XSLT in Firefox 2.0.0.1 and 1.5.0.9, it does not happen with 'normal' html and it does not happen in IE or earlier versions of Firefox.
Alex (ActiveWidgets)
December 21,
Alex, thanks for the update. That did fix our problems. We had gone down the path of wrapping and doing the onLoad, but just fixing the aw.js is a much better solution. We appreciate your responsiveness.

Dave
December 21,
Alex, unless you'd rather do it yourself (or have already done it) I'll submit this as a bug to the Mozilla project.
Dave
December 21,

This topic is archived.

See also:


Back to support forum