diff --git a/base/src/org/compiere/model/GridField.java b/base/src/org/compiere/model/GridField.java index f7f3058742..c2870839d7 100644 --- a/base/src/org/compiere/model/GridField.java +++ b/base/src/org/compiere/model/GridField.java @@ -1162,6 +1162,29 @@ public class GridField // m_propertyChangeListeners.firePropertyChange(PROPERTY, s_oldValue, null); } // setValue + /** + * Set Value to null. + *
+ * Do update context - called from GridTab.setCurrentRow + * Send Bean PropertyChange if there is a change + */ + public void setValueAndUpdateContext () + { + // log.fine(ColumnName + "=" + newValue); + if (m_valueNoFire) // set the old value + m_oldValue = m_value; + m_value = null; + m_inserting = false; + m_error = false; // reset error + + // [ 1881480 ] Navigation problem between tabs + Env.setContext(m_vo.ctx, m_vo.WindowNo, m_vo.ColumnName, (String) m_value); + + // Does not fire, if same value + m_propertyChangeListeners.firePropertyChange(PROPERTY, m_oldValue, m_value); + // m_propertyChangeListeners.firePropertyChange(PROPERTY, s_oldValue, null); + } // setValue + /** * Set Value. *
diff --git a/base/src/org/compiere/model/GridTab.java b/base/src/org/compiere/model/GridTab.java index 3f111be17a..d4e832c3b9 100644 --- a/base/src/org/compiere/model/GridTab.java +++ b/base/src/org/compiere/model/GridTab.java @@ -2190,7 +2190,16 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable // Object value = null; // if (mField.isKey() || mField.isParent() || mField.getColumnName().equals(m_linkColumnName)) // value = mField.getDefault(); - mField.setValue(); + + // CarlosRuiz - globalqss [ 1881480 ] Navigation problem between tabs + // the implementation of linking with window context variables is very weak + // you must be careful when defining a column in a detail tab with a field + // with the same column name as some of the links of the tabs above + // this can cause bad behavior of linking + if (mField.getColumnName().equals(m_linkColumnName)) + mField.setValue(); + else + mField.setValueAndUpdateContext(); } } loadDependentInfo();