incubator-xap-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmarga...@apache.org
Subject svn commit: r528307 - in /incubator/xap/trunk/codebase/src/xap/bridges: basic/AbstractWidgetBridge.js dojo/SplitChildBridge.js
Date Fri, 13 Apr 2007 01:40:41 GMT
Author: jmargaris
Date: Thu Apr 12 18:40:40 2007
New Revision: 528307

URL: http://svn.apache.org/viewvc?view=rev&rev=528307
Log:
>From dgennaco https://issues.apache.org/jira/browse/XAP-366

Modified:
    incubator/xap/trunk/codebase/src/xap/bridges/basic/AbstractWidgetBridge.js
    incubator/xap/trunk/codebase/src/xap/bridges/dojo/SplitChildBridge.js

Modified: incubator/xap/trunk/codebase/src/xap/bridges/basic/AbstractWidgetBridge.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/codebase/src/xap/bridges/basic/AbstractWidgetBridge.js?view=diff&rev=528307&r1=528306&r2=528307
==============================================================================
--- incubator/xap/trunk/codebase/src/xap/bridges/basic/AbstractWidgetBridge.js (original)
+++ incubator/xap/trunk/codebase/src/xap/bridges/basic/AbstractWidgetBridge.js Thu Apr 12
18:40:40 2007
@@ -507,12 +507,8 @@
 			setterFunction.call(this,value) ;
 	}
 	else{
-		// passthrough unknown attribute to peer, we want to do this at least for ID
-		// not sure about other attributes...this will pass through things like
-		// onCommand which is bad...IMPORTANT revisit this
-		if (this.getRootDomNode()){
-			this.getRootDomNode().setAttribute(name,value);
-		}
+		// moved passthrough logic to setIdAttribute so id attribute 
+		// is reflected in peer
 	}	
 }
 
@@ -552,16 +548,12 @@
 	}
 	
 	// Connect "onCommand" to a special event for the widget:
-	if( !this._onCommandEvent){
-		this._onCommandEvent = this.getOnXFunction("onCommand") ;				
-	}		
 	dojo.event.connect(this.getPeer(),this.getPeerOnCommandEvent(),this,"_onCommandEvent") ;
 }
 
 
 
 
-
 xap.bridges.basic.AbstractWidgetBridge.prototype.getAllowedAttributes = function(){
 	// We need this to be an instance method to make it automatically
 	// heritable, but we're actually doing everything on the class/constructor:
@@ -648,12 +640,12 @@
 }
 
 xap.bridges.basic.AbstractWidgetBridge.prototype.getNewAllowedAttributes = function(){
-	return ["x","y","width","height","backgroundColor","class",
+	return ["id","x","y","width","height","backgroundColor","class",
 		"borderWidth","borderColor","borderStyle","margin",
 		"padding","color","textDecoration","fontFamily",
 		"fontStyle","fontWeight", "fontSize", "textAlign",
 		"popup","tooltip", "focused", "disabled","visible",
-		"onFocus","onBlur","onDoubleClick","onKeyDown",
+		"onActiveGained","onActiveLost","onDoubleClick","onKeyDown",
 		"onKeyUp","onKeyPress","onMouseDown","onMouseUp"];
 };
 
@@ -667,7 +659,14 @@
 	return this.constructor._nameToSetterMap ;
 }
 
-/** XML attribute set method for "x" */
+/** XML attribute set method for "id" - copies the id attribute to the peer */
+xap.bridges.basic.AbstractWidgetBridge.prototype.setIdAttribute = function(value){
+		if (this.getRootDomNode()){
+			this.getRootDomNode().setAttribute("id", value);
+		}
+}
+
+/** XML attribute set method for "visible" */
 xap.bridges.basic.AbstractWidgetBridge.prototype.setVisibleAttribute = function(value){
 	var rootNode = this.getRootDomNode();
 	if (!rootNode) return;
@@ -699,14 +698,14 @@
 
 /** XML attribute set methods for onXXX start */
 
-xap.bridges.basic.AbstractWidgetBridge.prototype.setOnFocusAttribute = function(value) {
+xap.bridges.basic.AbstractWidgetBridge.prototype.setOnActiveGainedAttribute = function(value)
{
 	// connect event, discard value
-	dojo.event.connectOnce(this.getRootDomNode(),"onfocus", this, "onFocus");
+	dojo.event.connectOnce(this.getRootDomNode(),"onfocus", this, "onActiveGained");
 };
 
-xap.bridges.basic.AbstractWidgetBridge.prototype.setOnBlurAttribute = function(value) {
+xap.bridges.basic.AbstractWidgetBridge.prototype.setOnActiveLostAttribute = function(value)
{
 	// connect event, discard value
-	dojo.event.connectOnce(this.getRootDomNode(),"onblur", this, "onBlur");
+	dojo.event.connectOnce(this.getRootDomNode(),"onblur", this, "onActiveLost");
 };
 
 xap.bridges.basic.AbstractWidgetBridge.prototype.setOnDoubleClickAttribute = function(value)
{
@@ -1074,7 +1073,7 @@
  * 
  * 
  */
-xap.bridges.basic.AbstractWidgetBridge.prototype.onFocus = function(e){
+xap.bridges.basic.AbstractWidgetBridge.prototype.onActiveGained = function(e){
 	if (!this._settingFocus){
 		this.addStyleState("Focused");
 		this.fireEvent("onActiveGained");
@@ -1084,7 +1083,7 @@
 	}
 }
 
-xap.bridges.basic.AbstractWidgetBridge.prototype.onBlur = function(e){
+xap.bridges.basic.AbstractWidgetBridge.prototype.onActiveLost = function(e){
 	this.removeStyleState("Focused");
 	this.fireEvent("onActiveLost");
 }

Modified: incubator/xap/trunk/codebase/src/xap/bridges/dojo/SplitChildBridge.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/codebase/src/xap/bridges/dojo/SplitChildBridge.js?view=diff&rev=528307&r1=528306&r2=528307
==============================================================================
--- incubator/xap/trunk/codebase/src/xap/bridges/dojo/SplitChildBridge.js (original)
+++ incubator/xap/trunk/codebase/src/xap/bridges/dojo/SplitChildBridge.js Thu Apr 12 18:40:40
2007
@@ -66,7 +66,7 @@
  * No new dynamic attributes
  */
 xap.bridges.dojo.SplitChildBridge.prototype.getAllowedAttributes = function(){
-	return [];
+	return ["id"];
 }	
 
 xap.bridges.dojo.SplitChildBridge.prototype.obtainPeer = function(){



Mime
View raw message