Roo/form/ComboBoxArray.js
[roojs1] / Roo / form / Field.js
index e63e092..7ad268d 100644 (file)
@@ -268,7 +268,7 @@ side          Add an error icon to the right of the field with a popup on hover
      * Resets the current field value to the originally loaded value and clears any validation messages
      */
     reset : function(){
-        this.setValue(this.originalValue);
+        this.setValue(this.resetValue);
         this.clearInvalid();
     },
 
@@ -282,6 +282,7 @@ side          Add an error icon to the right of the field with a popup on hover
 
         // reference to original value for reset
         this.originalValue = this.getValue();
+        this.resetValue =  this.getValue();
     },
 
     // private
@@ -361,12 +362,15 @@ side          Add an error icon to the right of the field with a popup on hover
         if(!this.rendered || this.preventMark){ // not rendered
             return;
         }
-        this.el.addClass(this.invalidClass);
+        
+        var obj = (typeof(this.combo) != 'undefined') ? this.combo : this; // fix the combox array!!
+        
+        obj.el.addClass(this.invalidClass);
         msg = msg || this.invalidText;
         switch(this.msgTarget){
             case 'qtip':
-                this.el.dom.qtip = msg;
-                this.el.dom.qclass = 'x-form-invalid-tip';
+                obj.el.dom.qtip = msg;
+                obj.el.dom.qclass = 'x-form-invalid-tip';
                 if(Roo.QuickTips){ // fix for floating editors interacting with DND
                     Roo.QuickTips.enable();
                 }
@@ -415,10 +419,12 @@ side          Add an error icon to the right of the field with a popup on hover
         if(!this.rendered || this.preventMark){ // not rendered
             return;
         }
-        this.el.removeClass(this.invalidClass);
+        var obj = (typeof(this.combo) != 'undefined') ? this.combo : this; // fix the combox array!!
+        
+        obj.el.removeClass(this.invalidClass);
         switch(this.msgTarget){
             case 'qtip':
-                this.el.dom.qtip = '';
+                obj.el.dom.qtip = '';
                 break;
             case 'title':
                 this.el.dom.title = '';
@@ -450,9 +456,7 @@ side          Add an error icon to the right of the field with a popup on hover
      */
     getRawValue : function(){
         var v = this.el.getValue();
-        if(v === this.emptyText){
-            v = '';
-        }
+        
         return v;
     },
 
@@ -462,9 +466,7 @@ side          Add an error icon to the right of the field with a popup on hover
      */
     getValue : function(){
         var v = this.el.getValue();
-        if(v === this.emptyText || v === undefined){
-            v = '';
-        }
+         
         return v;
     },
 
@@ -501,14 +503,14 @@ side          Add an error icon to the right of the field with a popup on hover
                 if(tag == 'input'){
                     return w + 2;
                 }
-                if(tag = 'textarea'){
+                if(tag == 'textarea'){
                     return w-2;
                 }
             }else if(Roo.isOpera){
                 if(tag == 'input'){
                     return w + 2;
                 }
-                if(tag = 'textarea'){
+                if(tag == 'textarea'){
                     return w-2;
                 }
             }