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/11/22 19:14:42 UTC

svn commit: r478290 - /incubator/xap/trunk/src/xap/bridges/xap/LabelBridge.js

Author: mturyn
Date: Wed Nov 22 11:14:41 2006
New Revision: 478290

URL: http://svn.apache.org/viewvc?view=rev&rev=478290
Log:
BUG:  Couldn't enable element by setting disabled=="false".
CAUSE:  1.) Bad bool-string handling ( !"false" == false), peer.setEnabled() wanted a string in any event.
Re:
http://issues.apache.org/jira/browse/XAP-164
http://issues.apache.org/jira/browse/XAP-165
http://issues.apache.org/jira/browse/XAP-106



Modified:
    incubator/xap/trunk/src/xap/bridges/xap/LabelBridge.js

Modified: incubator/xap/trunk/src/xap/bridges/xap/LabelBridge.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/bridges/xap/LabelBridge.js?view=diff&rev=478290&r1=478289&r2=478290
==============================================================================
--- incubator/xap/trunk/src/xap/bridges/xap/LabelBridge.js (original)
+++ incubator/xap/trunk/src/xap/bridges/xap/LabelBridge.js Wed Nov 22 11:14:41 2006
@@ -51,9 +51,15 @@
 	this.getPeer().setAutoWrap(autoWrap);
 }
 
-xap.bridges.xap.LabelBridge.prototype.setDisabledAttribute = function(disabled) {
-	xap.bridges.basic.AbstractWidgetBridge.prototype.setDisabledAttribute.call(this,disabled);
-	this.getPeer().setEnabled(!disabled);
+xap.bridges.xap.LabelBridge.prototype.setDisabledAttribute = function(szDisabled) {
+	xap.bridges.basic.AbstractWidgetBridge.prototype.setDisabledAttribute.call(this,szDisabled);
+	// !"false" == false, so be careful
+	// Default for enabled:
+	var szEnabled = "true" ;
+	if( szDisabled == "true" ){
+		szEnabled = "false" ;
+	}
+	this.getPeer().setEnabled(szEnabled);
 }
 
 xap.bridges.xap.LabelBridge.prototype.setImgAttribute = function(imgURL) {
@@ -65,8 +71,8 @@
 	this.getPeer().setImgBackground(imgURL);
 }
 
-xap.bridges.xap.LabelBridge.prototype.setImgDisabledAttribute = function(imgURL) {
-	this.getPeer().setImgDisabled(imgURL);
+xap.bridges.xap.LabelBridge.prototype.setImgDisabledAttribute = function(disabled) {
+	this.getPeer().setImgDisabled(disabled);
 }
 
 xap.bridges.xap.LabelBridge.prototype.setImgHeightAttribute = function(imgHeight) {