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/10/12 23:19:35 UTC

svn commit: r463508 - /incubator/xap/trunk/src/xap/widgets/dojo/TextField.js

Author: mturyn
Date: Thu Oct 12 16:19:34 2006
New Revision: 463508

URL: http://svn.apache.org/viewvc?view=rev&rev=463508
Log:
Added methods for handler's"maxLength", "selectable", "editable" (last two are the same for this widget, so far) attributes.

Modified:
    incubator/xap/trunk/src/xap/widgets/dojo/TextField.js

Modified: incubator/xap/trunk/src/xap/widgets/dojo/TextField.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/widgets/dojo/TextField.js?view=diff&rev=463508&r1=463507&r2=463508
==============================================================================
--- incubator/xap/trunk/src/xap/widgets/dojo/TextField.js (original)
+++ incubator/xap/trunk/src/xap/widgets/dojo/TextField.js Thu Oct 12 16:19:34 2006
@@ -23,6 +23,7 @@
 	templateCssPath: null ,
 	widgetType: "TextField",
 	isContainer: false,
+	_isRichText:false,
 	
 	//hook for attach event
 	onblur: function(){
@@ -34,6 +35,39 @@
 	
 	getText: function(){
 		return this.domNode.value;
+	},
+	
+	setRichText: function( bRich ){
+		this._isRichText = bRich ;
+	},
+	
+	isRichText: function(){
+		return this._isRichText ;
+	},	
+
+	setMaxLength: function( nMax ){
+		this.domNode.maxLength = nMax ;
+	},
+	
+	getMaxLength: function(){
+		return this.domNode.maxLength ;
+	},
+	
+	setReadOnly: function( bNonWritable ){
+		 var val = ""+bNonWritable ;
+		 var newVal = (val=="true")?true:false ;
+		 this.domNode.readOnly = newVal ;
+		 // Move this to css a.s.a.p:
+		 if( newVal=="true"){
+			this.domNode.style.backgroundColor= "#bbbbbb" ;
+		 } else {
+			this.domNode.style.backgroundColor= "#FFFFFF" ;		 
+		 }
+	},
+	
+	getReadOnly: function(){
+		return this.domNode.readOnly ;
 	}
+	
 }
 );