details:   https://code.openbravo.com/erp/devel/pi/rev/86ac4bc5c360
changeset: 15459:86ac4bc5c360
user:      Antonio Moreno <antonio.moreno <at> openbravo.com>
date:      Mon Feb 13 11:30:11 2012 +0100
summary:   Fixed issue 19321. Session variables will be computed correctly in 
case the Parent Id is 'null' (as a string)

diffstat:

 
modules/org.openbravo.client.application/src/org/openbravo/client/application/window/FormInitializationComponent.java
 |  17 +++++++--
 1 files changed, 12 insertions(+), 5 deletions(-)

diffs (38 lines):

diff -r a03579ebb79e -r 86ac4bc5c360 
modules/org.openbravo.client.application/src/org/openbravo/client/application/window/FormInitializationComponent.java
--- 
a/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/FormInitializationComponent.java
     Sun Feb 12 20:43:46 2012 +0100
+++ 
b/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/FormInitializationComponent.java
     Mon Feb 13 11:30:11 2012 +0100
@@ -113,17 +113,17 @@
       // - EDIT: used when the user opens a record in form view
       // - CHANGE: used when the user changes a field which should fire 
callouts or comboreloads
       // - SETSESSION: used when the user calls a process
-      String mode = (String) parameters.get("MODE");
+      String mode = readParameter(parameters, "MODE");
       // ID of the parent record
-      String parentId = (String) parameters.get("PARENT_ID");
+      String parentId = readParameter(parameters, "PARENT_ID");
       // The ID of the tab
-      String tabId = (String) parameters.get("TAB_ID");
+      String tabId = readParameter(parameters, "TAB_ID");
       // The ID of the record. Only relevant on EDIT, CHANGE and SETSESSION 
modes
-      String rowId = (String) parameters.get("ROW_ID");
+      String rowId = readParameter(parameters, "ROW_ID");
       // The IDs of the selected records in case more than one
       String multipleRowIds[] = (String[]) parameters.get("MULTIPLE_ROW_IDS");
       // The column changed by the user. Only relevant on CHANGE mode
-      String changedColumn = (String) parameters.get("CHANGED_COLUMN");
+      String changedColumn = readParameter(parameters, "CHANGED_COLUMN");
       Tab tab = OBDal.getInstance().get(Tab.class, tabId);
       BaseOBObject row = null;
       BaseOBObject parentRecord = null;
@@ -1559,4 +1559,11 @@
     return cachedStructures.getAuxiliarInputList(tabId);
   }
 
+  private String readParameter(Map<String, Object> parameters, String 
parameterName) {
+    String paramValue = (String) parameters.get(parameterName);
+    if (paramValue != null && paramValue.equalsIgnoreCase("null")) {
+      paramValue = null;
+    }
+    return paramValue;
+  }
 }

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to