WebFX WebBoard
Message Thread:
View All Messages
Back to WebFX
 Bug (?) in xtree, Jessie Hernandez, June 18, 2004

Subject: Bug (?) in xtree From: Jessie Hernandez Date: June 18, 2004


    I don't know if this is a bug or not, but I initially load a DIV with the contents generated from an WebFXLoadTree instance. During the course of my app., I must display the contents of a different file in the same DIV. What I'm doing is deleting the contents of the DIV (div.innerHTML = ""), setting the original WebFXLoadTree to null, then creating a new instance and writing the contents to the DIV. This works fine, except when I try to close a folder in the second generation of an WebFXLoadTree, I get an error in the deSelect method of WebFXTreeAbstractNode. The error is that "document.getElementById(this.id + '-anchor') is undefined" (this happens both on IE 6 and Netscape 7).

    What I did to work around this is put an "if" condition around the statements in the deSelect method, as so:

WebFXTreeAbstractNode.prototype.deSelect = function() {
 if( document.getElementById(this.id + '-anchor') )
  document.getElementById(this.id + '-anchor').className = '';
  webFXTreeHandler.selected = null;
 } // endif

    This fixed the problems on both browsers and opening/closing folders now works fine, whether I generated the tree initially or afterwards. If this is indeed a bug with WebFXTreeAbstractNode, then please include the above code in the deSelect method. If not, let me know how I should be doing the above (safely replacing the contents of a DIV with another instance of a WebFXTree). Thanks.



Jessie Hernandez



Enter your reply to this message below. HTML tags are not supported but words that start with http://, ftp:// or mailto: are converted to links.

View All Messages
Back to WebFX