Fixes issue 23975: Changes are only done when getValue() returns a string
authorAugusto Mauch <augusto.mauch@openbravo.com>
Tue, 04 Jun 2013 12:33:00 +0200
changeset 20509 51f380c29321
parent 20508 52742b2346be
child 20510 f7a3e45cbddf
Fixes issue 23975: Changes are only done when getValue() returns a string

The numeric handling only needed to be done when getValue() returns a string, that is, when the user has entered a new value or modified the existing one. The textualValue needed to be set also.
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-number.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-number.js	Tue Jun 04 10:20:19 2013 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-number.js	Tue Jun 04 12:33:00 2013 +0200
@@ -435,9 +435,9 @@
     if (isc.isA.String(this.getValue())) {
         value = OB.Utilities.Number.OBPlainToOBMasked(this.getValue(), this.typeInstance.maskNumeric, this.typeInstance.decSeparator, this.typeInstance.groupSeparator);
         this.setValue(OB.Utilities.Number.OBMaskedToJS(value, this.typeInstance.decSeparator, this.typeInstance.groupSeparator));
-    } else {
-        value = OB.Utilities.Number.OBPlainToOBMasked(this.getValue(), this.typeInstance.maskNumeric);
-        this.setValue(OB.Utilities.Number.OBMaskedToJS(value));
+        if (this.form.setTextualValue) {
+            this.form.setTextualValue(this.name, value, this.typeInstance);
+        }
     }
 
     if (this.grid && this.grid.isEditing && this.grid.isEditing()) {