[Project_owners] tree element changed from 1.7.x to 1.8a?

Matthew Wilson matthew at mjwilson.demon.co.uk
Fri Nov 26 07:29:31 EST 2004


Sudhakar Chandra wrote:
> My extension that works fine on 1.7.x is throwing an exception on 1.8a5.
> 
> My tree is constructed like so:
> 
> <tree id="feedsTree" flex="1" class="plain"
>     hidecolumnpicker="false" datasources="rdf:bookmarks"
>     ref="rdf:null" flags="dont-build-content"
>     seltype="single" onselect="return fetchFeed(event)">
>     <treecols>
>             <treecol id="feedlist-title" label="&feedlist.title;" 
> primary="true" persist="width ordinal hidden" flex="2"/>
>              <treecol id="feedlist-lastupdate" 
> label="&feedlist.lastupdate;" hidden="true"
>              persist="width ordinal hidden" flex="1"/>
>              <treecol id="feedlist-comment" label="&feedlist.comment;"
>              hidden="true" persist="width ordinal hidden" flex="1"/>
>              <treecol id="feedlist-url" label="&feedlist.url;"
>              hidden="true" persist="width ordinal hidden" flex="1"/>
>          </treecols>
> ...
> 
> My fetchFeed function is like so:
> 
> 
> function fetchFeed(tEvent) {
>     // feedsTree = document.getElementById("feedsTree");
>     feedsTree = tEvent.target;
> 
>     // If nothing was selected we have nothing to do
>     if (feedsTree.currentIndex < 0) { return false; }
> 
>     // If folder was selected we have nothing to do
>     fetchURL = feedsTree.builderView.getCellText(feedsTree.currentIndex, 
> "feedlist-url");
> 
>     if (! fetchURL) { return false; }
> ...
> 
> The exception is:
> 
> Error: uncaught exception: [Exception... "Could not convert JavaScript 
> argument arg 1 [nsITreeView.getCellText]"  nsresult: "0x80570009 
> (NS_ERROR_XPC_BAD_CONVERT_JS)"  location: "JS frame :: 
> chrome://habarixenu/content/habarixenu.js :: fetchFeed :: line 251" 
> data: no]
> 
> What gives? I tried using both feedsTree.view and feeddsTree.builderView

lxr shows that the interface was changed for bug 221619. The second 
parameter to getCellText is now an nsITreeColumn instead of a string.

http://bonsai.mozilla.org/cvsview2.cgi?diff_mode=context&whitespace_mode=show&file=nsITreeView.idl&branch=&root=/cvsroot&subdir=mozilla/layout/xul/base/src/tree/public&command=DIFF_FRAMESET&rev1=1.20&rev2=1.21

Matthew



More information about the Project_owners mailing list