[richfaces-svn-commits] JBoss Rich Faces SVN: r914 - trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Mon May 28 16:02:23 EDT 2007


Author: nbelaevski
Date: 2007-05-28 16:02:22 -0400 (Mon, 28 May 2007)
New Revision: 914

Modified:
   trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js
Log:
JS error on empty tree fixed

Modified: trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js
===================================================================
--- trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js	2007-05-28 19:26:47 UTC (rev 913)
+++ trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js	2007-05-28 20:02:22 UTC (rev 914)
@@ -107,10 +107,12 @@
 
 		this.elements.contentTd = $(contentId);
 
-		for (var i = 0; i < this.elements.contentTd.childNodes.length; i++) {
-			var child = this.elements.contentTd.childNodes[i];
-			if (child.nodeType == 1 && child.tagName.toLowerCase() == "table") {
-				this.addChild(new Tree.Item(child.id, this, this, this.childs.length, this.switchType));
+		if (this.elements.contentTd) {
+			for (var i = 0; i < this.elements.contentTd.childNodes.length; i++) {
+				var child = this.elements.contentTd.childNodes[i];
+				if (child.nodeType == 1 && child.tagName.toLowerCase() == "table") {
+					this.addChild(new Tree.Item(child.id, this, this, this.childs.length, this.switchType));
+				}
 			}
 		}
 	},




More information about the richfaces-svn-commits mailing list