details:   https://code.openbravo.com/erp/devel/pi/rev/baf72de5b678
changeset: 28547:baf72de5b678
user:      Carlos Aristu <carlos.aristu <at> openbravo.com>
date:      Thu Jan 28 17:22:21 2016 +0100
summary:   fixes issue 32007: combo/selector with a callout can cause a double 
FIC request

If a form redrawal was fired after selecting a value of a combo/selector with a 
callout, a double request to the datasource was being performed due to 
asynchrony problems. An example of this scenario is when after selecting a 
value of a combo/selector with a callout, the form needs to be scrolled 
(overflow) because new fields are displayed in the form (for example because 
this fields have a display logic).

This kind of scenarios are now detected in the change event of the 
OBSelectorItem class, when the value to be updated is null but at the same time 
the pick list already contains a selected value.

diffstat:

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

diffs (16 lines):

diff -r bf85e00422d0 -r baf72de5b678 
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
      Mon Jan 25 13:07:24 2016 +0100
+++ 
b/modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-item.js
      Thu Jan 28 17:22:21 2016 +0100
@@ -626,6 +626,12 @@
     // only do the identifier actions when clearing
     // in all other cases pickValue is called
     if (!newValue) {
+      if (this.getElementValue() === "" && this.pickList && 
this.pickList.getSelectedRecord() && this.pickList.getSelectedRecord().id) {
+        // handle special case: after selecting a value, a redraw is fired in 
the form.
+        // due to asynchrony problems, the redraw flow was able to access to 
_value before setting it with the current value.
+        // if we are in this case, then we do not need to continue setting the 
value because 'null' is not the value to be assigned.
+        return;
+      }
       this.setValueFromRecord(null);
     }
     if (OB.Utilities.isUUID(newValue)) {

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to