diff --git a/org.adempiere.base/src/org/compiere/model/GridTab.java b/org.adempiere.base/src/org/compiere/model/GridTab.java index da3a1381ed..cb5df676a3 100644 --- a/org.adempiere.base/src/org/compiere/model/GridTab.java +++ b/org.adempiere.base/src/org/compiere/model/GridTab.java @@ -2775,8 +2775,9 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable // Get dependent MFields (may be because of display or dynamic lookup) for (GridField dependentField : getDependantFields(columnName)) { - if (dependentField == null || dependentField.isLookupEditorSettingValue()) continue; - + if (dependentField == null || dependentField.isLookupEditorSettingValue()) + continue; + // if the field has a lookup if (dependentField.getLookup() instanceof MLookup) { @@ -2787,12 +2788,13 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable { if (log.isLoggable(Level.FINE)) log.fine(columnName + " changed - " + dependentField.getColumnName() + " set to null"); + mLookup.refresh(); Object currentValue = dependentField.getValue(); // invalidate current selection setValue(dependentField, null); - if (currentValue != null && mLookup.containsKey(currentValue)) + if (currentValue != null && mLookup.containsKeyNoDirect(currentValue)) setValue(dependentField, currentValue); } } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java index 2502ff421c..33019fa8f8 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java @@ -69,7 +69,6 @@ import org.compiere.model.GridTable; import org.compiere.model.GridWindow; import org.compiere.model.I_AD_Preference; import org.compiere.model.MColumn; -import org.compiere.model.MLookup; import org.compiere.model.MPreference; import org.compiere.model.MRole; import org.compiere.model.MSysConfig; @@ -1372,27 +1371,12 @@ DataStatusListener, IADTabpanel, IdSpace, IFieldEditorContainer || (Core.findCallout(gridTab.getTableName(), mField.getColumnName())).size()>0 || gridTab.hasDependants(mField.getColumnName()))) { + // IDEMPIERE-4106 Refresh the list (lookup) on dependant fields was moved inside processFieldChange->processDependencies String msg = gridTab.processFieldChange(mField); // Dependencies & Callout if (msg.length() > 0) { FDialog.error(windowNo, this, msg); } - - // Refresh the list on dependant fields - for (GridField dependentField : gridTab.getDependantFields(mField.getColumnName())) - { - // if the field has a lookup - if (dependentField != null && dependentField.getLookup() instanceof MLookup) - { - MLookup mLookup = (MLookup)dependentField.getLookup(); - // if the lookup is dynamic (i.e. contains this columnName as variable) - if (mLookup.getValidation().indexOf("@"+mField.getColumnName()+"@") != -1) - { - mLookup.refresh(); - } - } - } // for all dependent fields - } //if (col >= 0) if (!uiCreated)