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/16 05:51:42 UTC

svn commit: r431835 - /incubator/xap/trunk/src/xap/bridges/basic/DomNodeBridge.js

Author: mturyn
Date: Tue Aug 15 22:51:41 2006
New Revision: 431835

URL: http://svn.apache.org/viewvc?rev=431835&view=rev
Log:
Adapted it to a more flexible "put me in the DOM tree" method in the abstract superclass, which in this class' case is a null-op, since it's already wehre it should be.

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

Modified: incubator/xap/trunk/src/xap/bridges/basic/DomNodeBridge.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/bridges/basic/DomNodeBridge.js?rev=431835&r1=431834&r2=431835&view=diff
==============================================================================
--- incubator/xap/trunk/src/xap/bridges/basic/DomNodeBridge.js (original)
+++ incubator/xap/trunk/src/xap/bridges/basic/DomNodeBridge.js Tue Aug 15 22:51:41 2006
@@ -41,7 +41,7 @@
  * @author mturyn
  */
 xap.bridges.basic.DomNodeBridge = function() {
-	xap.taghandling.AbstractTagImpl.call( this );
+	xap.bridges.basic.AbstractBlackBoxWidgetBridge.call( this );
 	if(arguments[0]){
 		this._peer = arguments[0] ;
 	}
@@ -59,15 +59,14 @@
 xap.bridges.basic.DomNodeBridge.prototype.obtainPeer = function() {
 	var parent = this.getElement().getParent();
 	var handler = this.getUiContentHandler().getHandlerForElement( parent );
-	var parentPeer = handler.getPeer();
 	
 	// If we don't have a peer, try to find one:
 	if ( !this._peer ) {
     	try {
-		var displayerId = this.getElement().getAttribute("displayerId")  ;    	
-		var peer = document.getElementById(displayerId) ;
-		// This method does more than just set the _peer member; it
-		// can also set up handlers.....
+			var nodeId = this.getElement().getAttribute("wrappedNodeId")  ;    	
+			var peer = document.getElementById(nodeId) ;
+			// This method does more than just set the _peer member; it
+			// can also set up handlers.....
     		this.setPeer(peer) ;
         } catch ( e ) {
         	alert(e);
@@ -84,11 +83,20 @@
 		var name = event.getName();
 		var value = event.getNewValue();
 		var peer = this.getPeer() ;
-		
+
 		if(name=="innerHTML"){
 			peer.innerHTML = value ;
+			return ;
+		}
+		
+		if(name=="wrappedNodeId"){
+			var element = document.getElementById( value) ;
+			if( element ){
+				this.setPeer(element) ;		
+			}
 		}
 		
+		
 	// Prefer setters to direct field settings, node attributes last?:
 		var setterName = "set" + name.substring(0,1).toUpperCase() +name.substring(1) ;
 		if( peer[setterName]){
@@ -101,9 +109,21 @@
 }
 	
 /**
- *  Since this just wrappers a dom node peer, this function is simple here---return the peer.
- **/
+ *  Since this just wraps a dom node peer, this function is simple here---return the peer.
+ *  ---and because we haven't overwritten AbstractBlackBoxWidgetBridge,
+ *  this.getDisplayDomNode == this.getRootDomeNode....
+**/
  xap.bridges.basic.DomNodeBridge.prototype.getRootDomNode = function(){
  	return this.getPeer() ;
  }
+ 
+
+/**
+ * Set this xaplet's location in the HTML DOM---it's already got one, so do nothing.
+**/ 
+xap.bridges.basic.DomNodeBridge.prototype.setHtmlDomLocation = function(parentPeerDomNode){
+	// Do NOTHING, INTENTIONALLY.
+}
+ 
+