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/11 19:31:21 UTC

svn commit: r430870 - in /incubator/xap/trunk/src/xap/bridges: basic/AbstractBlackBoxWidgetBridge.js dojo/DojoWidgetBridge.js

Author: mturyn
Date: Fri Aug 11 12:31:21 2006
New Revision: 430870

URL: http://svn.apache.org/viewvc?rev=430870&view=rev
Log:
Specify target node for xaplet better; take account of case where peer has no show() method.

Modified:
    incubator/xap/trunk/src/xap/bridges/basic/AbstractBlackBoxWidgetBridge.js
    incubator/xap/trunk/src/xap/bridges/dojo/DojoWidgetBridge.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=430870&r1=430869&r2=430870&view=diff
==============================================================================
--- incubator/xap/trunk/src/xap/bridges/basic/AbstractBlackBoxWidgetBridge.js (original)
+++ incubator/xap/trunk/src/xap/bridges/basic/AbstractBlackBoxWidgetBridge.js Fri Aug 11 12:31:21 2006
@@ -89,7 +89,9 @@
 	this.parseInitialAttributes( this.getElement() );
 	this.parseInitialChildren( this.getElement() );
 	xap.taghandling.AbstractTagImpl.prototype.init.call( this );
-	this.getPeer().show();
+	if( this.getPeer().show){
+		this.getPeer().show();
+	}
 }
 
 xap.bridges.basic.AbstractBlackBoxWidgetBridge.FUNCTION="function" ; 
@@ -172,7 +174,19 @@
 		}
 		dojo.event.connect(this.getPeer(),this.getPeerOnCommandEvent(),this,"_onCommandEvent") ;
 
-		parentPeerDomNode.appendChild(this.getDisplayDomNode()) ;
+	// By default, component goes within parent's HTML DOM node;
+	//---but can specify another one as below:
+	// NOTE: TO_DO:  Decide if this is a permissible behaviour.
+		var parentDomNode = parentPeerDomNode ;
+		
+	    	if( this.getSpecifiedAttachmentNode){ 
+	    		var specifiedDomNode = this.getSpecifiedAttachmentNode() ;
+			if ( specifiedDomNode){
+		    		parentDomNode = specifiedDomNode ;
+		    }
+		}
+
+		parentDomNode.appendChild(this.getDisplayDomNode()) ;
 
 	} 
 }
@@ -248,7 +262,7 @@
  * lay out the location for a component.
  *
 **/ 
-xap.bridges.basic.AbstractBlackBoxWidgetBridge.prototype.getOriginalDomNode = function(){
+xap.bridges.basic.AbstractBlackBoxWidgetBridge.prototype.getSpecifiedAttachmentNode = function(){
 	// What will the id of the node to which we'll attach this widget be?
 	var elementId = this.getElement().getAttribute("elementId");
 	return document.getElementById(elementId);

Modified: incubator/xap/trunk/src/xap/bridges/dojo/DojoWidgetBridge.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/bridges/dojo/DojoWidgetBridge.js?rev=430870&r1=430869&r2=430870&view=diff
==============================================================================
--- incubator/xap/trunk/src/xap/bridges/dojo/DojoWidgetBridge.js (original)
+++ incubator/xap/trunk/src/xap/bridges/dojo/DojoWidgetBridge.js Fri Aug 11 12:31:21 2006
@@ -132,7 +132,7 @@
 		}	    
 
 		// If we've specified a node....
-	    var specifiedDomNode = this.getOriginalDomNode() ;
+	    var specifiedDomNode = this.getSpecifiedAttachmentNode() ;
 	    if ( specifiedDomNode){
 	    	parentPeerNode = specifiedDomNode ;
 	    }