From 45200670fb5d9a9aae91071a69e10ecfa99f0a66 Mon Sep 17 00:00:00 2001 From: teo_sarca Date: Sun, 27 Feb 2011 00:29:18 -0500 Subject: [PATCH] Lines Tab read only on new doc after completing Link to SF Tracker: http://sourceforge.net/support/tracker.php?aid=3033485 globalqss -> Integrating fix for annoying bug from http://adempiere.svn.sourceforge.net/viewvc/adempiere?view=revision&revision=13343 --- .../src/org/compiere/model/GridTab.java | 2 ++ .../src/org/compiere/util/Env.java | 24 +++++++++++++++++++ 2 files changed, 26 insertions(+) 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