related to issue 27240: improvements in new method
authorCarlos Aristu <carlos.aristu@openbravo.com>
Wed, 02 Dec 2015 10:00:19 +0100
changeset 28086 2ad48c10e4ea
parent 28085 0a811f99d7f8
child 28087 1e56db81f203
related to issue 27240: improvements in new method

make the method available for all parameters, this way it can be used in general. The handleItemChange() will only be executed if the parameter has an On Change Function
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-parameter-window-form.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-parameter-window-form.js	Wed Dec 02 09:27:26 2015 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-parameter-window-form.js	Wed Dec 02 10:00:19 2015 +0100
@@ -38,14 +38,12 @@
 
   setItems: function (itemList) {
     itemList.forEach(function (item) {
-      if (item.onChangeFunction) {
-        item.setValueAndHandleItemChange = function () {
-          this.Super('setValue', arguments);
-          if (this.view && this.view.theForm) {
-            this.view.theForm.handleItemChange(item);
-          }
-        };
-      }
+      item.setValueProgrammatically = function () {
+        this.Super('setValue', arguments);
+        if (this.onChangeFunction && this.view && this.view.theForm) {
+          this.view.theForm.handleItemChange(item);
+        }
+      };
     });
     this.Super('setItems', arguments);
   },