details:   /erp/devel/pi/rev/7b921a4dc6a2
changeset: 12232:7b921a4dc6a2
user:      Antonio Moreno <antonio.moreno <at> openbravo.com>
date:      Wed May 18 17:05:24 2011 +0200
summary:   Fixed issue 17239. Resolved auxiliary input accidental resetting.
Two changes have been made:
- The FIC will no longer compute auxiliary inputs on CHANGE mode. This will 
prevent it from resetting auxiliary inputs which were set by a previously 
called callout (which was called in a previous request).
- In the client, auxiliary inputs will not be deleted every time the FIC 
response includes one/more values. This therefore will prevent the client from 
wiping out previously computed callouts.

diffstat:

 
modules/org.openbravo.client.application/src/org/openbravo/client/application/window/FormInitializationComponent.java
 |  7 +++++++
 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-form.js
                      |  1 -
 2 files changed, 7 insertions(+), 1 deletions(-)

diffs (28 lines):

diff -r f0b613e9997f -r 7b921a4dc6a2 
modules/org.openbravo.client.application/src/org/openbravo/client/application/window/FormInitializationComponent.java
--- 
a/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/FormInitializationComponent.java
     Wed May 18 16:50:05 2011 +0200
+++ 
b/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/FormInitializationComponent.java
     Wed May 18 17:05:24 2011 +0200
@@ -610,6 +610,13 @@
   }
 
   private void computeAuxiliaryInputs(String mode, Tab tab, Map<String, 
JSONObject> columnValues) {
+    if (mode.equals("CHANGE")) {
+      // Auxiliary Inputs are not computed in CHANGE mode, only in the initial 
request in NEW or
+      // EDIT mode. This is done to prevent accidental overwriting of 
auxiliary input values which
+      // have been set by callouts
+      // See issue 17239 for more information
+      return;
+    }
     for (AuxiliaryInput auxIn : tab.getADAuxiliaryInputList()) {
       Object value = computeAuxiliaryInput(auxIn, tab.getWindow().getId());
       log.debug("Final Computed Value. Name: " + auxIn.getName() + " Value: " 
+ value);
diff -r f0b613e9997f -r 7b921a4dc6a2 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-form.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-form.js
  Wed May 18 16:50:05 2011 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-form.js
  Wed May 18 17:05:24 2011 +0200
@@ -571,7 +571,6 @@
       this.view.messageBar.setMessage(isc.OBMessageBar.TYPE_INFO, null, 
calloutMessages[0]);
     }
     if (auxInputs) {
-      this.auxInputs = {};
       for (prop in auxInputs) {
         if (auxInputs.hasOwnProperty(prop)) {
           value = typeof auxInputs[prop].value !== 'undefined' ? 
auxInputs[prop].value : '';

------------------------------------------------------------------------------
What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its 
next-generation tools to help Windows* and Linux* C/C++ and Fortran 
developers boost performance applications - including clusters. 
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to