Fixes Issue 27621: Button works after interruption by network issues.
authorShankar Balachandran <shankar.balachandran@openbravo.com>
Thu, 18 Sep 2014 20:10:02 +0530
changeset 24445 fe985b84dd7f
parent 24444 04ae35aa72e5
child 24446 fd85fc030a49
child 24447 f593014afc2a
Fixes Issue 27621: Button works after interruption by network issues.

The problem was if you get a network interruption when clicking on the edit item button,
then the button does not work anymore.The opening variable was not reset in case of errors.
Now it has been reset.
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-action-button.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-action-button.js	Wed Sep 17 11:48:36 2014 +0000
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-action-button.js	Thu Sep 18 20:10:02 2014 +0530
@@ -102,7 +102,13 @@
 
       if (!me.opening) {
         me.opening = true; // To avoid button could be clicked twice
-        theView.setContextInfo(sessionProperties, callbackFunction, true);
+        try {
+          theView.setContextInfo(sessionProperties, callbackFunction, true);
+        } catch (e) {
+          // to reset the button in case of any errors when processing button action.
+          // refer issue https://issues.openbravo.com/view.php?id=27621
+          me.opening = false;
+        }
       }
       return;
     }