:: Forum >>

Need Help - Bug in AW.UI.Tree in Firefox

Alex (and all),

I have been working on a page that loads an AW tree dynamically and I believe I stumbled across a problem in Firefox. If I assign the tree a new set of items via setItemText, the tree will display them perfectly in IE, however, in Firefox, the contents spill over the scroll bars and remain that way until you click on one of the items. I have some stripped down sample code below to demonstrate the problem...

Thanks for your time.

Dan Bright


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Tree View Test</title>
<script src="../../include/activewidgets/runtime/lib/aw.js"></script>
<link href="../../include/activewidgets/runtime/styles/xp/aw.css" rel="stylesheet"></link>
<script>
var arrayTreeItems = null;
var arrayTreeIndices = null;

function reloadContents()
{
arrayTreeItems = new Array();
arrayTreeIndices = new Array();

arrayTreeItems[0] = "";
arrayTreeIndices = new Array();
arrayTreeIndices[0] = new Array();

var nLastParentIndex = 0;
var currentSubTree = null;

for (var nIndex = 0; nIndex < 20; nIndex++)
{
var strNewNodeName = "Test Node" + nIndex;
arrayTreeItems.push(strNewNodeName);

var nodeIndices = new Array();
arrayTreeIndices.push(nodeIndices);
arrayTreeIndices[0].push(nIndex + 1);
}

objTree.setItemText(arrayTreeItems);

objTree.clearSelectedModel()
objTree.setSelectedItems([]);

objTree.refresh();
}

function onViewIndicesHandler(item, i)
{
return arrayTreeIndices[i];
}

function onViewCountHandler(item, i)
{
return arrayTreeIndices[i] ? arrayTreeIndices[i].length : 0;
}

function reloadTree()
{
reloadContents();
}
</script>
</head>

<body topmargin="0" leftmargin="0">
<input id="push" name="push" type="button" onclick="reloadTree();">
<div style="width:700px;height:460px;position:relative;background-color:#f5f5f5;border:1px solid #cccccc;">
<script>
var objTree = new AW.UI.Tree;
objTree.setId("mytree");
arrayTreeItems = new Array("");
arrayTreeIndices = new Array();
arrayTreeIndices[0] = new Array();

objTree.setSize(280,250);
objTree.setItemText(arrayTreeItems);
objTree.setViewCount(function(i){ return onViewCountHandler(this, i)});
objTree.setViewIndices(function(i) { return onViewIndicesHandler(this, i)});
objTree.refresh();
document.write(objTree);
</script>
</div>
</body>
</html>
Dan Bright
Tuesday, October 10, 2006
* bump *
Dan Bright
Thursday, October 12, 2006
Resolved. The code in question was referencing AW 2.0.0. Using 2.0.1 fixes the problem.

Thanks for your help Alex. I appreciate it.
Thursday, October 12, 2006

This topic is archived.


Back to support forum

Forum search