Fixes issue 21654: Selecting a blank option enables the save toolbar buttons
authorAugusto Mauch <augusto.mauch@openbravo.com>
Mon, 17 Sep 2012 13:27:00 +0200
changeset 17966 3add0cfef5fa
parent 17965 48eb2242e8fb
child 17967 7c3050fc5c15
Fixes issue 21654: Selecting a blank option enables the save toolbar buttons

In the pickValue of the ob-formitem-list file, the _value attribute was set to '' to always trigger the update. This did not work because then selecting a blank option would not trigger the update.

Now, the _value attribute is set to a random number.
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-list.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-list.js	Fri Sep 14 15:03:28 2012 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-list.js	Mon Sep 17 13:27:00 2012 +0200
@@ -67,7 +67,7 @@
     // if the user has entered with the keyboard the exact content of a list option,
     // its callout would not be called because the change would not be detected
     // see issue https://issues.openbravo.com/view.php?id=21491
-    this._value = '';
+    this._value = (this.value) ? this._value.concat(Math.random()) : Math.random();
     this.Super('pickValue', arguments);
     delete this._pickedValue;
     if (this.moveFocusOnPickValue && this.form.focusInNextItem) {