diff --git a/org.adempiere.base/src/org/compiere/model/GridField.java b/org.adempiere.base/src/org/compiere/model/GridField.java index 428cbc661b..a8c66e0df1 100644 --- a/org.adempiere.base/src/org/compiere/model/GridField.java +++ b/org.adempiere.base/src/org/compiere/model/GridField.java @@ -1523,7 +1523,7 @@ public class GridField else if (m_value instanceof Boolean) { backupValue(); // teo_sarca [ 1699826 ] - if (!isParentTabField()) + if (!isParentTabField() && isUpdateWindowContext()) { Env.setContext(m_vo.ctx, m_vo.WindowNo, m_vo.ColumnName, ((Boolean)m_value).booleanValue()); @@ -1534,7 +1534,7 @@ public class GridField else if (m_value instanceof Timestamp) { backupValue(); // teo_sarca [ 1699826 ] - if (!isParentTabField()) + if (!isParentTabField() && isUpdateWindowContext()) { Env.setContext(m_vo.ctx, m_vo.WindowNo, m_vo.ColumnName, (Timestamp)m_value); } @@ -1554,7 +1554,7 @@ public class GridField else { backupValue(); // teo_sarca [ 1699826 ] - if (!isParentTabField()) + if (!isParentTabField() && isUpdateWindowContext()) { Env.setContext(m_vo.ctx, m_vo.WindowNo, m_vo.ColumnName, m_value==null ? null : m_value.toString()); @@ -2060,6 +2060,14 @@ public class GridField return isParentTabField(m_vo.ColumnName); } + private boolean isUpdateWindowContext() + { + if (getGridTab() != null) + return getGridTab().isUpdateWindowContext(); + + return true; + } + /*IDEMPIERE-358*/ public int getXPosition() diff --git a/org.adempiere.base/src/org/compiere/model/GridTab.java b/org.adempiere.base/src/org/compiere/model/GridTab.java index 523668a748..ef267eb1a0 100644 --- a/org.adempiere.base/src/org/compiere/model/GridTab.java +++ b/org.adempiere.base/src/org/compiere/model/GridTab.java @@ -2708,6 +2708,8 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable private List activeCallouts = new ArrayList(); private List activeCalloutInstance = new ArrayList(); + private boolean m_updateWindowContext = true; + /** * * @return list of active call out for this tab @@ -3212,4 +3214,14 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable public boolean isNew() { return isOpen() && getCurrentRow() >= 0 && getCurrentRow() == m_mTable.getNewRow(); } + + public boolean isUpdateWindowContext() + { + return m_updateWindowContext ; + } + + public void setUpdateWindowContext(boolean updateWindowContext) + { + m_updateWindowContext = updateWindowContext; + } } // GridTab diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java index e5ac357ed4..88553b11fe 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java @@ -533,6 +533,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements // Query first tab if (tabIndex == 0) { + gTab.setUpdateWindowContext(true); m_queryInitiating = true; getComponent().setVisible(false); initialQuery(query, gTab, new Callback() { @@ -565,6 +566,10 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements }); } + else + { + gTab.setUpdateWindowContext(false); + } if (gTab.isSortTab()) { @@ -1149,8 +1154,13 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements return; } - IADTabpanel newTabpanel = adTabbox.getSelectedTabpanel(); + + //toggle window context update + if (newTabpanel.getGridTab() != null) + newTabpanel.getGridTab().setUpdateWindowContext(true); + if (oldTabIndex > newTabIndex && oldTabpanel.getGridTab() != null) + oldTabpanel.getGridTab().setUpdateWindowContext(false); boolean activated = newTabpanel.isActivated(); if (oldTabpanel != null)