Fixes Issue 0024638: An error appears when using a field in the tab display logic which is present in the header and also in the tab
authorShankar Balachandran <shankar.balachandran@openbravo.com>
Mon, 30 Sep 2013 17:25:31 +0530
changeset 21218 73df6c79ca82
parent 21217 50c111e5cff8
child 21219 237a498f9e4d
Fixes Issue 0024638: An error appears when using a field in the tab display logic which is present in the header and also in the tab

The following actions has been done to fix the issue.
* When generating display logic for tabs, the parameter needs to be fetched from context and not from currentValues.
* When executing the display logic for a tab at runtime, always use the context of the parent,
as that contains the context variables for displaying the child tab.
modules/org.openbravo.client.application/src/org/openbravo/client/application/DynamicExpressionParser.java
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/DynamicExpressionParser.java	Mon Sep 30 12:09:46 2013 +0200
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/DynamicExpressionParser.java	Mon Sep 30 17:25:31 2013 +0530
@@ -323,7 +323,7 @@
         if (field.getColumn() == null) {
           continue;
         }
-        if (token.equalsIgnoreCase(field.getColumn().getDBColumnName())) {
+        if (token.equalsIgnoreCase(field.getColumn().getDBColumnName()) && !tabLevelDisplayLogic) {
           fieldsInExpression.add(field);
           final String fieldName = KernelUtils.getInstance()
               .getPropertyFromColumn(field.getColumn()).getName();
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js	Mon Sep 30 12:09:46 2013 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js	Mon Sep 30 17:25:31 2013 +0530
@@ -1358,7 +1358,7 @@
         tabViewPane = this.childTabSet.tabs[i].pane;
         // Calling getContextInfo with (false, true, true) in order to obtain also the value of the
         // session attributes of the form
-        if (tabViewPane.showTabIf && !(tabViewPane.showTabIf(tabViewPane.getContextInfo(false, true, true)))) {
+        if (tabViewPane.showTabIf && !(tabViewPane.showTabIf(this.getContextInfo(false, true, true)))) {
           this.childTabSet.tabBar.members[i].hide();
           tabViewPane.hidden = true;
         } else {