Fixed issue 17205. Auxiliary Inputs will be recomputed before callouts.
authorAntonio Moreno <antonio.moreno@openbravo.com>
Wed, 18 May 2011 09:49:45 +0200
changeset 12211 ead0927e415d
parent 12210 e49590067220
child 12212 4f0bf76a1b92
Fixed issue 17205. Auxiliary Inputs will be recomputed before callouts.
This means that if a callout modifies an auxiliary input value, its execution will override the previously calculated value instead of being overwritten afterwards.
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 09:36:50 2011 +0200
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/FormInitializationComponent.java	Wed May 18 09:49:45 2011 +0200
@@ -219,6 +219,12 @@
           changedColumn, jsContent, changeEventCols, calloutsToCall, lastfieldChanged,
           visibleProperties);
 
+      if (mode.equals("NEW")) {
+        // In the case of NEW mode, we compute auxiliary inputs again to take into account that
+        // auxiliary inputs could depend on a default value
+        computeAuxiliaryInputs(mode, tab, columnValues);
+      }
+
       // Execution of callouts
       long t6 = System.currentTimeMillis();
       List<String> changedCols = executeCallouts(mode, tab, columnValues, changedColumn,
@@ -233,11 +239,6 @@
       long t7 = System.currentTimeMillis();
       List<JSONObject> attachments = attachmentForRows(tab, rowId, multipleRowIds);
 
-      if (mode.equals("NEW")) {
-        // In the case of NEW mode, we compute auxiliary inputs again to take into account that
-        // auxiliary inputs could depend on a default value
-        computeAuxiliaryInputs(mode, tab, columnValues);
-      }
       // Construction of the final JSONObject
       long t8 = System.currentTimeMillis();
       JSONObject finalObject = buildJSONObject(mode, tab, columnValues, row, changeEventCols,