fixed bug 26189: filter typed in drop down is cleared
authorAsier Lostalé <asier.lostale@openbravo.com>
Tue, 08 Apr 2014 16:15:40 +0200
changeset 22888 dc59e523d1cb
parent 22887 b0829884d505
child 22889 4a57750631e2
fixed bug 26189: filter typed in drop down is cleared
modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-item.js
modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/js/ob-smartclient.js
--- a/modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-item.js	Tue Apr 08 15:32:57 2014 +0200
+++ b/modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-item.js	Tue Apr 08 16:15:40 2014 +0200
@@ -438,6 +438,18 @@
     }
   },
 
+  filterComplete: function () {
+    var ret;
+
+    // Prevents validation of this item while filtering because real value is
+    // not yet set. This also caused form item to be redrawn removing typed 
+    // text for filtering (see issue #26189)
+    this.preventValidation = true;
+    ret = this.Super('filterComplete', arguments);
+    delete this.preventValidation;
+    return ret;
+  },
+
   hidePickListOnBlur: function () {
     // when the form gets redrawn the focus may not be in
     // the item but it is still the item which gets the focus
--- a/modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/js/ob-smartclient.js	Tue Apr 08 15:32:57 2014 +0200
+++ b/modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/js/ob-smartclient.js	Tue Apr 08 16:15:40 2014 +0200
@@ -540,6 +540,11 @@
     if (this.form && this.form.grid && this.form.grid._showingEditor) {
       return;
     }
+
+    if (this.preventValidation) {
+      return;
+    }
+
     return this._original_validate();
   },