From 4ff74bfef3d7074856872d9005012900f1c6dfee Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Thu, 28 Nov 2013 12:59:08 -0500 Subject: [PATCH] IDEMPIERE-1232 Zoom condition fixes / found problem obtaining parent tab on MZoomCondition as the variable _TabInfo_TabLevel has not been initialized - when navigating to BP Location it finds User BP Access as parent tab instead of the master BP --- .../src/org/compiere/model/GridTab.java | 14 +++++++------- .../src/org/compiere/model/GridWindow.java | 1 + 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/GridTab.java b/org.adempiere.base/src/org/compiere/model/GridTab.java index a4b516641f..3e83e0232e 100644 --- a/org.adempiere.base/src/org/compiere/model/GridTab.java +++ b/org.adempiere.base/src/org/compiere/model/GridTab.java @@ -3163,13 +3163,13 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable int parentLevel = currentLevel-1; if (parentLevel < 0) return tabNo; - while (parentLevel != currentLevel) - { - tabNo--; - currentLevel = Env.getContextAsInt(m_vo.ctx, m_vo.WindowNo, tabNo, GridTab.CTX_TabLevel); - if (tabNo == 0) - break; - } + while (parentLevel != currentLevel) + { + tabNo--; + currentLevel = Env.getContextAsInt(m_vo.ctx, m_vo.WindowNo, tabNo, GridTab.CTX_TabLevel); + if (tabNo == 0) + break; + } return tabNo; } diff --git a/org.adempiere.base/src/org/compiere/model/GridWindow.java b/org.adempiere.base/src/org/compiere/model/GridWindow.java index 3eabbc77f3..af60c55880 100644 --- a/org.adempiere.base/src/org/compiere/model/GridWindow.java +++ b/org.adempiere.base/src/org/compiere/model/GridWindow.java @@ -166,6 +166,7 @@ public class GridWindow implements Serializable if (mTabVO != null) { GridTab mTab = new GridTab(mTabVO, this, m_virtual); + Env.setContext(m_vo.ctx, m_vo.WindowNo, t, GridTab.CTX_TabLevel, Integer.toString(mTab.getTabLevel())); m_tabs.add(mTab); } } // for all tabs