details:   /erp/devel/pi/rev/9121d767d7f3
changeset: 12132:9121d767d7f3
user:      Martin Taal <martin.taal <at> openbravo.com>
date:      Thu May 12 15:46:33 2011 +0200
summary:   Fixes issue 17136: You cannot enter to Menu window but an ugly error 
shows up

details:   /erp/devel/pi/rev/184bd464aefe
changeset: 12133:184bd464aefe
user:      Martin Taal <martin.taal <at> openbravo.com>
date:      Thu May 12 15:46:50 2011 +0200
summary:   Related to issue 16611: Initial request done by UI selector element 
in form view does not use any filters or paging

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-standard-view-datasource.js
  |   4 +-
 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-grid.js
                 |   2 +
 
modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-item.js
     |   2 +
 
modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/js/ob-smartclient.js
 |  11 ++++++++++
 4 files changed, 17 insertions(+), 2 deletions(-)

diffs (73 lines):

diff -r 33867e2a810b -r 184bd464aefe 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-standard-view-datasource.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-standard-view-datasource.js
   Thu May 12 15:41:09 2011 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-standard-view-datasource.js
   Thu May 12 15:46:50 2011 +0200
@@ -155,8 +155,8 @@
       if (errorStatus) {
         var handled = this.view.setErrorMessageFromResponse(dsResponse, 
jsonData, dsRequest);
         
-        if (!handled && !dsRequest.willHandleError) {
-          OB.KernelUtilities.handleSystemException(error.message);
+        if (!handled && !dsRequest.willHandleError && jsonData.response && 
jsonData.response.error) { 
+          
OB.KernelUtilities.handleSystemException(jsonData.response.error.message);
         }
       } else {
         // there are some cases where the jsonData is not passed, in case of
diff -r 33867e2a810b -r 184bd464aefe 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-grid.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-grid.js
  Thu May 12 15:41:09 2011 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-grid.js
  Thu May 12 15:46:50 2011 +0200
@@ -1823,6 +1823,7 @@
   // having a valueMap property results in setValueMap to be called
   // on an item. On items with a picklist this causes calls to the
   // server side
+  //  https://issues.openbravo.com/view.php?id=16611
   getEditItem: function() {
     var result = this.Super('getEditItem', arguments);
     if (result.hasOwnProperty('valueMap') && !result.valueMap) {
@@ -1833,6 +1834,7 @@
 
   // set some flags to prevent the picklist fields from doing extra datasource 
   // requests
+  // https://issues.openbravo.com/view.php?id=16611
   storeUpdatedEditorValue : function (suppressChange, editCol) {
     this._storingUpdatedEditorValue = true;
     this.Super('storeUpdatedEditorValue', arguments);
diff -r 33867e2a810b -r 184bd464aefe 
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 May 12 15:41:09 2011 +0200
+++ 
b/modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-item.js
      Thu May 12 15:46:50 2011 +0200
@@ -323,6 +323,7 @@
 
   // don't do update value in all cases, updatevalue results in a data source 
request
   // to the server, so only do updatevalue when the user changes information
+  // https://issues.openbravo.com/view.php?id=16611
   updateValue: function () {
     if (this.form && this.form.grid && 
         (this.form.grid._storingUpdatedEditorValue || 
this.form.grid._showingEditor || this.form.grid._hidingInlineEditor)) {
@@ -334,6 +335,7 @@
   
   // at setvalue set the display value in a valuemap to prevent datasource 
requests to
   // get the display value
+  // https://issues.openbravo.com/view.php?id=16611
   setValue: function(newValue) {
     if (this.form && this.form.getValues() && this.form.getValues()[this.name] 
=== newValue &&
         this.form.getValues()[this.name + '._identifier']) {
diff -r 33867e2a810b -r 184bd464aefe 
modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/js/ob-smartclient.js
--- 
a/modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/js/ob-smartclient.js
  Thu May 12 15:41:09 2011 +0200
+++ 
b/modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/js/ob-smartclient.js
  Thu May 12 15:46:50 2011 +0200
@@ -277,6 +277,17 @@
   }
 });
 
+// if not overridden then also errors handled by OB are shown in a popup
+// see https://issues.openbravo.com/view.php?id=17136
+isc.RPCManager.addClassProperties({
+  _handleError: isc.RPCManager.getPrototype().handleError,
+  handleError : function (response, request) {
+    if (!request.willHandleError) {
+      this._handleError(response, request);
+    }
+  }
+})
+
 // uncomment this code and put a breakpoint to get a better control
 // on from where async operations are started
 //isc.Class._fireOnPause = isc.Class.fireOnPause;

------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding 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