************************************************************
* Call to xpconnect wrapped JSObject produced this error: *
[Exception... "'[JavaScript Error: "this.growTopicTrees is not a function"
{file: "chrome://ubimarks/content/topicSelectionTree.xml" line: 120}]'
when calling method: [nsIDOMEventListener::handleEvent]"
nsresult: "0x80570021 (NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)"
location: "<unknown>" data: yes]
************************************************************
This is the binding. It doesn't matter is I use the constructor or the
handler or
loadBindingDocument() function.
I used to call viewCommonTopics() with load event handler connected to a
window and it still does call this function.
However the growTopicTrees function is not a function anymore...
<binding id = "ubiSelectTopicsTree">
<content>
<xul:tree flex = "1">
<xul:treecols>
<xul:treecol id = "topicName"
label = "Topic Name:"
primary = "true"
flex = "1"
seltype="single"/>
<xul:splitter/>
<xul:treecol id = "selectedCol"
label = "Selected:"
cycler = "true"/>
</xul:treecols>
<xul:treechildren id = "ubiSelectTopicsRoot" />
</xul:tree>
</content>
<handlers>
<handler event = "bindingattached" ><![CDATA[
loadBindingDocument('chrome://ubimarks/content/topicSelectionTree.xml');
this.viewCommonTopics();
]]></handler>
<handler event = "select"
action = "event.stopPropagation();" />
<handler event = "click"
action = "this.checkTopic(event);event.stopPropagation();" />
</handlers>
<implementation>
<constructor><![CDATA[
dump("ubiSelectTopicsTree/constructor\n");
<!--
window.addEventListener("load", this.viewCommonTopics, false);
-->
]]></constructor>
<method name = "viewCommonTopics">
<!--
/**
* List topics in a tree hierarchy
*/
-->
<body><![CDATA[
dump("ubiSelectTopicsTree/viewCommonTopics\n");
var
datasrc = getReadUbiDS(),
topicroots = getRootTopics(datasrc);
<!-- is not a function ?? -->
this.growTopicTrees(datasrc, topicroots);
window.sizeToContent();
]]></body>
</method>
<method name = "growTopicTrees">
<!--
/**
* Build a topic tree from each root in the list of root topics.
*/
-->
<parameter name = "aDatasrc" />
<parameter name = "aRoots" />
<body><![CDATA[
if (!aRoots) {
return;
}
/* get empty treechildren element */
var
treechildrenroot =
document.getElementById("ubiSelectTopicsRoot");
/* go through the topic hierarchies */
for (var i = 0; i < aRoots.length; i++) {
var
topictreeitem = this.initTopicItemHierarchy(aDatasrc,
aRoots[i].topic);
treechildrenroot.appendChild(topictreeitem);
if (i < (aRoots.length - 1)) {
var
treeseparator = document.createElement("treeseparator");
treechildrenroot.appendChild(treeseparator);
}
}
]]></body>
</method>
...
</binding>