diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/GridController.java b/org.adempiere.ui.swing/src/org/compiere/grid/GridController.java index cd4ca49d87..a67d885bc1 100644 --- a/org.adempiere.ui.swing/src/org/compiere/grid/GridController.java +++ b/org.adempiere.ui.swing/src/org/compiere/grid/GridController.java @@ -709,6 +709,25 @@ public class GridController extends CPanel { // start loading while building screen m_mTab.query(onlyCurrentRows, onlyCurrentDays, maxRows); + + //make sure value from previous query is clear from window context + if (m_mTab.getRowCount() == 0) + { + if (getGCParent() != null) + { + ArrayList parentColumnNames = new ArrayList(); + GridField[] parentFields = getGCParent().getMTab().getFields(); + for (GridField parentField : parentFields) + parentColumnNames.add(parentField.getColumnName()); + + GridField[] fields = m_mTab.getFields(); + for (GridField field : fields) + { + if (!parentColumnNames.contains(field.getColumnName())) + Env.setContext(Env.getCtx(), field.getWindowNo(), field.getColumnName(), ""); + } + } + } // Update UI if (!isSingleRow()) vTable.autoSize(true); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ADTabpanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ADTabpanel.java index c960dad21a..83d3f332cd 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ADTabpanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ADTabpanel.java @@ -908,10 +908,25 @@ DataStatusListener, IADTabpanel, VetoableChangeListener } if (!includedPanel.isEmpty() && e.getChangedColumn() == -1) { + ArrayList parentColumnNames = new ArrayList(); + GridField[] parentFields = gridTab.getFields(); + for (GridField parentField : parentFields) + parentColumnNames.add(parentField.getColumnName()); + for (EmbeddedPanel panel : includedPanel) + { + GridTab tab = panel.tabPanel.getGridTab(); + GridField[] fields = tab.getFields(); + for (GridField field : fields) + { + if (!parentColumnNames.contains(field.getColumnName())) + Env.setContext(Env.getCtx(), field.getWindowNo(), field.getColumnName(), ""); + } panel.tabPanel.query(false, 0, 0); - } + } + parentColumnNames = null; + } } private void deleteNode(int recordId) {