details:   https://code.openbravo.com/erp/devel/pi/rev/250e1f8a4a94
changeset: 15781:250e1f8a4a94
user:      Augusto Mauch <augusto.mauch <at> openbravo.com>
date:      Tue Mar 13 10:08:31 2012 +0100
summary:   Related to issue 19694: All date grid fields are updated correctly

The previous commit (changeset 15758) fixed the behaviour of the date grid 
fields that had a callback, but broke the date grid fields that did not. Now 
the way to update a date field is the following:
- If parsing is prevent (while the field is being entered, for example) do not 
update the field either. If the parsing is not done but the field is updated 
anyway, the field gets to store invalid values. The update will only be done 
after the value has been parsed.
- After parsing and updating, force the new value to be updated in 
grid.getEnteredValues(). This had to be explicitly done because otherwise the 
field is not yet updated in that structure when making the FIC call, causing 
the previous value to be re-entered.

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-date.js
 |  12 ++++++++-
 1 files changed, 10 insertions(+), 2 deletions(-)

diffs (24 lines):

diff -r cb2a09cf5599 -r 250e1f8a4a94 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-date.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-date.js
        Tue Mar 13 09:58:57 2012 +0100
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-date.js
        Tue Mar 13 10:08:31 2012 +0100
@@ -209,10 +209,18 @@
   // update the value in update value as this is called from cellEditEnd in the
   // grid, or after losing the focus on the form
   updateValue: function () {
-    if (!this.grid || !this.grid._preventDateParsing) {
-      this.expandValue();
+    if (this.grid && this.grid._preventDateParsing) {
+      return;
     }
+    this.expandValue();
     this.Super('updateValue', arguments);
+    //  when the date field has a callout and all the mandatory fields have 
been entered, 
+    //  the grid does not save the value before making the FIC call, so the 
value has to 
+    //  be saved explicitly
+    //  See issue 19694 (https://issues.openbravo.com/view.php?id=19694)
+    if (this.grid) {
+        this.grid.getEditValues(this.grid.getEditRow())[this.name] = 
this.getValue();  
+    }
   },
 
 

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to