incubator-xap-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mtu...@apache.org
Subject svn commit: r433125 - /incubator/xap/trunk/src/xap/bridges/basic/AbstractBlackBoxWidgetBridge.js
Date Mon, 21 Aug 2006 02:58:22 GMT
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()) ;
 }
 
 



Mime
View raw message