Related to issue 16341. Fixed other potential resets by a callout, which had the same cause.
authorAntonio Moreno <antonio.moreno@openbravo.com>
Thu, 17 Mar 2011 10:58:48 +0100
changeset 11279 5b9a7474d70f
parent 11278 4d83c0358bfc
child 11280 01190a3d77a9
child 11281 8b9a7f487985
Related to issue 16341. Fixed other potential resets by a callout, which had the same cause.
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	Thu Mar 17 10:04:42 2011 +0100
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/FormInitializationComponent.java	Thu Mar 17 10:58:48 2011 +0100
@@ -405,12 +405,13 @@
                 "inp" + Sqlc.TransformaNombreColumna(col));
             String newValue = jsonobject.has("classicValue") ? jsonobject.getString("classicValue")
                 : (jsonobject.has("value") ? jsonobject.getString("value") : null);
-            if (newValue != null && newValue.equals("null")) {
-              newValue = null;
+            if (newValue == null || newValue.equals("null")) {
+              newValue = "";
             }
-            if (!(oldValue == null && newValue == null)
-                && ((oldValue == null && newValue != null)
-                    || (oldValue != null && newValue == null) || !oldValue.equals(newValue))) {
+            if (oldValue == null || oldValue.equals("null")) {
+              oldValue = "";
+            }
+            if (!oldValue.equals(newValue)) {
               changedCols.add(field.getColumn().getDBColumnName());
             }
           }