diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoWindow.java index aad5d841b7..116295486e 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoWindow.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoWindow.java @@ -23,6 +23,7 @@ import org.adempiere.webui.component.Label; import org.adempiere.webui.component.Row; import org.adempiere.webui.component.Rows; import org.adempiere.webui.editor.WEditor; +import org.adempiere.webui.editor.WTableDirEditor; import org.adempiere.webui.editor.WebEditorFactory; import org.adempiere.webui.event.ValueChangeEvent; import org.adempiere.webui.event.ValueChangeListener; @@ -610,6 +611,7 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL if (mField.getDisplayType() == DisplayType.PAttribute) { editor = new WInfoPAttributeEditor(infoContext, p_WindowNo, mField); + editor.setReadWrite(true); } else { @@ -798,6 +800,7 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL if (evt != null && evt.getSource() instanceof WEditor) { WEditor editor = (WEditor)evt.getSource(); + boolean asiChanged = false; if (evt.getNewValue() == null) { Env.setContext(infoContext, p_WindowNo, editor.getColumnName(), ""); Env.setContext(infoContext, p_WindowNo, Env.TAB_INFO, editor.getColumnName(), ""); @@ -811,11 +814,16 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL Env.setContext(infoContext, p_WindowNo, editor.getColumnName(), evt.getNewValue().toString()); Env.setContext(infoContext, p_WindowNo, Env.TAB_INFO, editor.getColumnName(), evt.getNewValue().toString()); } + // if attribute set changed (from any value to any value) clear the attribute set instance m_pAttributeWhere + if (editor instanceof WTableDirEditor && editor.getColumnName().equals("M_AttributeSet_ID")) + asiChanged = true; for(WEditor otherEditor : editors) { if (otherEditor == editor) continue; + if (asiChanged && otherEditor instanceof WInfoPAttributeEditor) + ((WInfoPAttributeEditor)otherEditor).clearWhereClause(); otherEditor.dynamicDisplay(); } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/WInfoPAttributeEditor.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/WInfoPAttributeEditor.java index 9f4df318c5..16650a2f6f 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/WInfoPAttributeEditor.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/WInfoPAttributeEditor.java @@ -109,6 +109,10 @@ public class WInfoPAttributeEditor extends WEditor implements IWhereClauseEditor return m_pAttributeWhere; } + public void clearWhereClause() { + m_pAttributeWhere = null; + } + /** * Query per Product Attribute. * @@ -138,7 +142,7 @@ public class WInfoPAttributeEditor extends WEditor implements IWhereClauseEditor @Override public void dynamicDisplay() { - int attributeSetId = Env.getContextAsInt(ctx, windowNo, Env.TAB_INFO, "M_AttributeSet_ID"); - setReadWrite(attributeSetId > 0); + // int attributeSetId = Env.getContextAsInt(ctx, windowNo, Env.TAB_INFO, "M_AttributeSet_ID"); + // setReadWrite(attributeSetId > 0); } }