details:   https://code.openbravo.com/erp/devel/pi/rev/0a811f99d7f8
changeset: 28084:0a811f99d7f8
user:      Carlos Aristu <carlos.aristu <at> openbravo.com>
date:      Wed Dec 02 09:27:26 2015 +0100
summary:   fixes issue 27240: On Change Function in Process Definition non 
editable fields

The handleItemChange method is the method in charge of execute the on change 
function on onblur. This event is not fired when setting the value of a field 
programmatically. To solve this, a new method has been introduced in the API: 
setValueAndHandleItemChange() which invokes handleItemChange() after setting 
the value of a the field.

This method will be available automatically just for those Process Definition 
fields with an on change function assigned to them through the application 
dictionary.

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-parameter-window-form.js
 |  14 ++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diffs (24 lines):

diff -r 5e894b37c168 -r 0a811f99d7f8 
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
      Tue Dec 01 23:08:54 2015 +0000
+++ 
b/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
@@ -36,6 +36,20 @@
     this.paramWindow.handleButtonsStatus();
   },
 
+  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);
+          }
+        };
+      }
+    });
+    this.Super('setItems', arguments);
+  },
+
   // this function is invoked on the blur action of the formitems
   // this is the proper place to execute the client-side callouts
   handleItemChange: function (item) {

------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140
_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to