details:   https://code.openbravo.com/erp/devel/pi/rev/69400c6e986b
changeset: 30405:69400c6e986b
user:      Asier Lostalé <asier.lostale <at> openbravo.com>
date:      Thu Oct 13 15:59:17 2016 +0200
summary:   fixed bug 34200: client side callouts executed twice

  When picking a value from a selector drop down, its associated client side
  callouts were executed twice.

  The problem was caused because in this situation fullIdentifierEntered flag
  was set to true and it causes the field blur event to trigger again the 
callouts.

  It has been prevented by adding a new valuePicked flag which is set to true
  when a value is picked from drop down, in this case fullIdentifierEntered is
  not set to true.

diffstat:

 
modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-item.js
 |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r 0d765967dc06 -r 69400c6e986b 
modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-item.js
--- 
a/modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-item.js
      Thu Oct 13 09:28:06 2016 +0000
+++ 
b/modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-item.js
      Thu Oct 13 15:59:17 2016 +0200
@@ -672,7 +672,7 @@
 
     // check if the whole item identifier has been entered
     // see issue https://issues.openbravo.com/view.php?id=22821
-    if (OB.Utilities.isUUID(this.mapDisplayToValue(identifier)) && 
this._notUpdatingManually !== true) {
+    if (OB.Utilities.isUUID(this.mapDisplayToValue(identifier)) && 
this._notUpdatingManually !== true && !this.valuePicked) {
       this.fullIdentifierEntered = true;
     } else {
       delete this.fullIdentifierEntered;
@@ -1004,10 +1004,13 @@
   },
 
   pickValue: function (value) {
+    var selectedRecord, ret;
     // get the selected record before calling the super, as this super call
     // will deselect the record
-    var selectedRecord = this.pickList.getSelectedRecord(),
-        ret = this.Super('pickValue', arguments);
+    selectedRecord = this.pickList.getSelectedRecord();
+    this.valuePicked = true;
+    ret = this.Super('pickValue', arguments);
+    delete this.valuePicked;
     this.setValueFromRecord(selectedRecord);
     delete this.fullIdentifierEntered;
     return ret;

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to