diff --git a/org.adempiere.base/src/org/compiere/model/GridTab.java b/org.adempiere.base/src/org/compiere/model/GridTab.java index 45c492f08c..2f21d1fedf 100644 --- a/org.adempiere.base/src/org/compiere/model/GridTab.java +++ b/org.adempiere.base/src/org/compiere/model/GridTab.java @@ -613,6 +613,8 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable { if (!m_loadComplete) initTab(false); + Env.clearTabContext(m_vo.ctx, m_vo.WindowNo, m_vo.TabNo); + log.fine("#" + m_vo.TabNo + " - Only Current Rows=" + onlyCurrentRows + ", Days=" + onlyCurrentDays + ", Detail=" + isDetail()); diff --git a/org.adempiere.base/src/org/compiere/util/Env.java b/org.adempiere.base/src/org/compiere/util/Env.java index 4a49e9fbc9..59f641443e 100644 --- a/org.adempiere.base/src/org/compiere/util/Env.java +++ b/org.adempiere.base/src/org/compiere/util/Env.java @@ -1210,6 +1210,30 @@ public final class Env } } // clearWinContext + /** + * Clean up context for Window Tab (i.e. delete it). + * Please note that this method is not clearing the tab info context (i.e. _TabInfo). + * @param ctx context + * @param WindowNo window + * @param TabNo tab + */ + public static void clearTabContext(Properties ctx, int WindowNo, int TabNo) + { + if (ctx == null) + throw new IllegalArgumentException ("Require Context"); + // + Object[] keys = ctx.keySet().toArray(); + for (int i = 0; i < keys.length; i++) + { + String tag = keys[i].toString(); + if (tag.startsWith(WindowNo+"|"+TabNo+"|") + && !tag.startsWith(WindowNo+"|"+TabNo+"|_TabInfo")) + { + ctx.remove(keys[i]); + } + } + } + /** * Clean up all context (i.e. delete it) * @param ctx context