You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xap-commits@incubator.apache.org by mt...@apache.org on 2006/08/21 02:58:22 UTC

svn commit: r433125 - /incubator/xap/trunk/src/xap/bridges/basic/AbstractBlackBoxWidgetBridge.js

Author: mturyn
Date: Sun Aug 20 19:58:21 2006
New Revision: 433125

URL: http://svn.apache.org/viewvc?rev=433125&view=rev
Log:
Fixed layout behaviours:  1.) default is now for widgets not to have a container node (node that can have child nodes laid out in it).  
2. Default now is for "root" node to be child node when laying out.

Modified:
    incubator/xap/trunk/src/xap/bridges/basic/AbstractBlackBoxWidgetBridge.js

Modified: incubator/xap/trunk/src/xap/bridges/basic/AbstractBlackBoxWidgetBridge.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/bridges/basic/AbstractBlackBoxWidgetBridge.js?rev=433125&r1=433124&r2=433125&view=diff
==============================================================================
--- incubator/xap/trunk/src/xap/bridges/basic/AbstractBlackBoxWidgetBridge.js (original)
+++ incubator/xap/trunk/src/xap/bridges/basic/AbstractBlackBoxWidgetBridge.js Sun Aug 20 19:58:21 2006
@@ -232,10 +232,20 @@
 	var parentPeerDomNode = null ;
 
 	if ( parentHandler.getDisplayDomNode ){
+		if (!parentHandler.getDisplayDomNode()){
+			throw new xap.util.Exception(
+						"Problem inserting component managed by "
+						+ this.toString()
+						+ " into a container managed by " 
+						+ parentHandler.toString()
+						+ "; parent doesn't have a suitable container."
+											) ;
+			return ;
+		}	
 	// The parent is another bridge
 	// Get the display node associated with the bridge's parent, since this represents the 
 	// place in the HTML DOM	
-		 parentPeerDomNode = parentHandler.getDisplayDomNode() ;
+		parentPeerDomNode = parentHandler.getDisplayDomNode() ;
 	}  else if (parentPeer.innerHTML){
 		// This is already an HTML element or equivalent:
 		// (Is there a better way of telling an HTML element?)
@@ -279,12 +289,11 @@
 }
 
 /**
-  *   Default behaviour: is that the node used to attach this widget as a child of another one
-  * or of a DOM node is the same one that should be used as a container for child nodes or
-  *  widgets.  Lowest common denominator.
+  *  Default behaviour: most widgets are not containers, so they have
+  *  none such.  Lowest common denominator.
  **/
 xap.bridges.basic.AbstractBlackBoxWidgetBridge.prototype.getDisplayDomNode =  function(){
-	return this.getRootDomNode() ;
+	return null;
 }
 
 /**
@@ -483,7 +492,7 @@
 			// get the name of the event into the callback definition, so
 			// "onBlur"  --> this.fireEvent("onBlur")
 			this[trigger] = this.getOnXFunction(trigger) ;				
-		}	
+		}		
 		dojo.event.connect(source,trigger, this,trigger);				
 	}
 	
@@ -510,7 +519,7 @@
 	    }
 	}
 
-	parentDomNode.appendChild(this.getDisplayDomNode()) ;
+	parentDomNode.appendChild(this.getRootDomNode()) ;
 }