From xap-commits-return-1311-apmail-incubator-xap-commits-archive=incubator.apache.org@incubator.apache.org Fri Apr 13 01:41:02 2007 Return-Path: Delivered-To: apmail-incubator-xap-commits-archive@locus.apache.org Received: (qmail 38430 invoked from network); 13 Apr 2007 01:41:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Apr 2007 01:41:02 -0000 Received: (qmail 14812 invoked by uid 500); 13 Apr 2007 01:41:08 -0000 Delivered-To: apmail-incubator-xap-commits-archive@incubator.apache.org Received: (qmail 14797 invoked by uid 500); 13 Apr 2007 01:41:08 -0000 Mailing-List: contact xap-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: xap-dev@incubator.apache.org Delivered-To: mailing list xap-commits@incubator.apache.org Received: (qmail 14787 invoked by uid 99); 13 Apr 2007 01:41:08 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Apr 2007 18:41:08 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Apr 2007 18:41:01 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id B18671A9838; Thu, 12 Apr 2007 18:40:41 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: xap-commits@incubator.apache.org From: jmargaris@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070413014041.B18671A9838@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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(){