fixed bug 0009503: Messages not translated using setTitle function of OBError
authorAsier Lostalé <asier.lostale@openbravo.com>
Wed, 01 Jul 2009 10:15:05 +0200
changeset 4081 486e0ca2fdb6
parent 4080 3f159d6df853
child 4082 e990231b7c1b
fixed bug 0009503: Messages not translated using setTitle function of OBError
src-wad/src/org/openbravo/wad/ActionButtonJava_Responser.javaxml
src-wad/src/org/openbravo/wad/javasource.javaxml
--- a/src-wad/src/org/openbravo/wad/ActionButtonJava_Responser.javaxml	Wed Jul 01 09:56:07 2009 +0200
+++ b/src-wad/src/org/openbravo/wad/ActionButtonJava_Responser.javaxml	Wed Jul 01 10:15:05 2009 +0200
@@ -81,17 +81,22 @@
         <FIELD_TMP id="FieldsLoadParams3">PInstanceProcessData.insertPInstanceParam(this, pinstance, )</FIELD_TMP>
         
         pb.setParams(params);
-       
+        OBError myMessage = null;
         try {
           <FIELD_TMP id="ProcessCode3">execute process</FIELD_TMP>
-        } catch (Exception e) {
-          //do nothing...
-          e.printStackTrace();
+          myMessage = (OBError) pb.getResult();
+          myMessage.setMessage(Utility.parseTranslation(this, vars, vars.getLanguage(), myMessage.getMessage()));
+          myMessage.setTitle(Utility.parseTranslation(this, vars, vars.getLanguage(), myMessage.getTitle()));
+        } catch (Exception ex) {
+          myMessage = Utility.translateError(this, vars, vars.getLanguage(), ex.getMessage());
+          log4j.error(ex);
+          if (!myMessage.isConnectionAvailable()) {
+            bdErrorConnection(response);
+            return;
+          }
         }
-        
- 
 
-        processButtonHelper(request, response, vars, (OBError)pb.getResult());        
+        processButtonHelper(request, response, vars, myMessage);        
 </FIELDS_TMP>
     } else pageErrorPopUp(response);
   }
--- a/src-wad/src/org/openbravo/wad/javasource.javaxml	Wed Jul 01 09:56:07 2009 +0200
+++ b/src-wad/src/org/openbravo/wad/javasource.javaxml	Wed Jul 01 10:15:05 2009 +0200
@@ -494,6 +494,7 @@
           <FIELD_TMP id="ProcessCode3j">execute process</FIELD_TMP>
           myMessage = (OBError) pb.getResult();
           myMessage.setMessage(Utility.parseTranslation(this, vars, vars.getLanguage(), myMessage.getMessage()));
+          myMessage.setTitle(Utility.parseTranslation(this, vars, vars.getLanguage(), myMessage.getTitle()));
         } catch (Exception ex) {
           myMessage = Utility.translateError(this, vars, vars.getLanguage(), ex.getMessage());
           log4j.error(ex);