details:   /erp/devel/pi/rev/b0e385d74031
changeset: 12261:b0e385d74031
user:      Martin Taal <martin.taal <at> openbravo.com>
date:      Thu May 19 12:44:18 2011 -0700
summary:   Fixes issue 17290: Infinite looping when saving and calling FIC for 
changed item

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-form.js
 |  11 +++++++--
 1 files changed, 8 insertions(+), 3 deletions(-)

diffs (31 lines):

diff -r e293c786c85c -r b0e385d74031 
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
  Thu May 19 12:32:32 2011 -0700
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-form.js
  Thu May 19 12:44:18 2011 -0700
@@ -861,7 +861,9 @@
 
   // called explicitly onblur and when non-editable fields change
   handleItemChange: function(item){
-  
+    // is used to prevent infinite loops during save
+    delete this.saveFocusItemChanged;
+
     if (item._hasChanged) {
       this.itemChangeActions();
       
@@ -989,11 +991,14 @@
   saveRow: function(){
     var savingNewRecord = this.isNew;
     // store the value of the current focus item
-    if (this.getFocusItem()) {
+    if (this.getFocusItem() && this.saveFocusItemChanged !== 
this.getFocusItem()) {
       this.getFocusItem().updateValue();
       this.handleItemChange(this.getFocusItem());
+      // prevent infinite loops
+      this.saveFocusItemChanged = this.getFocusItem();
+    } else {
+      delete this.saveFocusItemChanged;
     }
-
     
     var i, length, flds, form = this, ficCallDone;
     var record = form.view.viewGrid.getSelectedRecord(),

------------------------------------------------------------------------------
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