Roo/form/ComboBox.js
authorAlan Knowles <alan@akbkhome.com>
Mon, 14 Nov 2011 09:35:21 +0000 (17:35 +0800)
committerAlan Knowles <alan@akbkhome.com>
Mon, 14 Nov 2011 09:35:21 +0000 (17:35 +0800)
Roo/form/ComboBox.js

index 93e176a..e283efc 100644 (file)
@@ -169,6 +169,8 @@ Roo.extend(Roo.form.ComboBox, Roo.form.TriggerField, {
      * in order for a value to be mapped.
      */
     valueField: undefined,
+    
+    
     /**
      * @cfg {String} hiddenName If specified, a hidden form field with this name is dynamically generated to store the
      * field's data value (defaults to the underlying DOM element's name)
@@ -299,6 +301,8 @@ Roo.extend(Roo.form.ComboBox, Roo.form.TriggerField, {
     addicon : false,
     editicon: false,
     
+    // element that contains real text value.. (when hidden is used..)
+    shadowNameEl : undefined,
     
     // private
     onRender : function(ct, position){
@@ -313,8 +317,7 @@ Roo.extend(Roo.form.ComboBox, Roo.form.TriggerField, {
             // prevent input submission
             //if (this.hiddenName == this.name) { 
             this.el.dom.removeAttribute('name');
-            this.hiddenNameField = this.el.insertSibling({tag:'input', type:'hidden', name: this.name}, 'before', true);
-            
+            this.shadowNameEl = this.el.insertSibling({tag:'input', type:'hidden', name: this.name}, 'before', true);
             
             
             //}
@@ -882,6 +885,7 @@ Roo.extend(Roo.form.ComboBox, Roo.form.TriggerField, {
         if(this.el.dom.value.length > 0){
             this.el.dom.value =
                 this.lastSelectionText === undefined ? '' : this.lastSelectionText;
+            this.shadowNameEl ? (this.shadowNameEl.dom.value = this.el.dom.value) : false;
             this.applyEmptyText();
         }
     },