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