details:   https://code.openbravo.com/erp/devel/pi/rev/7ebcdd2bf2c5
changeset: 34787:7ebcdd2bf2c5
user:      Javier Armendáriz <javier.armendariz <at> openbravo.com>
date:      Fri Sep 21 09:28:48 2018 +0200
summary:   Fixed issue 39201: Menu overlapped by messageBar if receiving a 
response from a closed window.

Instead of dissapearing, the menu were overlapped with a error messageBar which
originally belonged to the window that made the request (and were closed before
it finishes). This fix ensures the datasource window is not currently destroyed
to show the error message.

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view-datasource.js
 |  7 +++++--
 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
            |  4 ++--
 2 files changed, 7 insertions(+), 4 deletions(-)

diffs (45 lines):

diff -r ae5338494af6 -r 7ebcdd2bf2c5 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view-datasource.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view-datasource.js
      Wed Sep 12 19:08:49 2018 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view-datasource.js
      Fri Sep 21 09:28:48 2018 +0200
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2011-2015 Openbravo SLU
+ * All portions are Copyright (C) 2011-2018 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -212,7 +212,10 @@
     if (jsonData) {
       var errorStatus = !jsonData.response || jsonData.response.status === 
'undefined' || jsonData.response.status !== isc.RPCResponse.STATUS_SUCCESS;
       if (errorStatus) {
-        var handled = this.view.setErrorMessageFromResponse(dsResponse, 
jsonData, dsRequest);
+        var handled = false;
+        if (!this.view.destroyed) {
+          handled = this.view.setErrorMessageFromResponse(dsResponse, 
jsonData, dsRequest);
+        }
 
         if (!handled && !dsRequest.willHandleError && jsonData.response && 
jsonData.response.error) {
           
OB.KernelUtilities.handleSystemException(jsonData.response.error.message);
diff -r ae5338494af6 -r 7ebcdd2bf2c5 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
 Wed Sep 12 19:08:49 2018 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
 Fri Sep 21 09:28:48 2018 +0200
@@ -1362,7 +1362,7 @@
   shouldOpenDefaultEditMode: function () {
     // can open default edit mode if defaultEditMode is set
     // and this is the root view or a child view with a selected parent.
-    var oneOrMoreSelected = this.viewGrid.data && 
this.viewGrid.data.lengthIsKnown && this.viewGrid.data.lengthIsKnown() && 
this.viewGrid.data.getLength() >= 1;
+    var oneOrMoreSelected = this.viewGrid && this.viewGrid.data && 
this.viewGrid.data.lengthIsKnown && this.viewGrid.data.lengthIsKnown() && 
this.viewGrid.data.getLength() >= 1;
     return this.allowDefaultEditMode && oneOrMoreSelected && 
this.defaultEditMode && (this.isRootView || 
this.parentView.viewGrid.getSelectedRecords().length === 1);
   },
 
@@ -1832,7 +1832,7 @@
   },
 
   hasSelectionStateChanged: function () {
-    return ((this.viewGrid.getSelectedRecords() && 
this.viewGrid.getSelectedRecords().length !== this.lastRecordSelectedCount) || 
(this.viewGrid.getSelectedRecord() && this.viewGrid.getSelectedRecord().id !== 
this.lastRecordSelected.id)) || (this.lastRecordSelected && 
!this.viewGrid.getSelectedRecord());
+    return this.viewGrid && (((this.viewGrid.getSelectedRecords() && 
this.viewGrid.getSelectedRecords().length !== this.lastRecordSelectedCount) || 
(this.viewGrid.getSelectedRecord() && this.viewGrid.getSelectedRecord().id !== 
this.lastRecordSelected.id)) || (this.lastRecordSelected && 
!this.viewGrid.getSelectedRecord()));
   },
 
   updateLastSelectedState: function () {


_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to