From e3769972ee07a0674fea48566b7d2a8b1e7ce2dc Mon Sep 17 00:00:00 2001 From: Diego Ruiz Date: Sun, 25 Mar 2018 22:11:09 +0200 Subject: [PATCH] IDEMPIERE-3667 Callouts not working properly in Quick Entry Windows --- .../org/adempiere/webui/grid/WQuickEntry.java | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/grid/WQuickEntry.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/grid/WQuickEntry.java index c5b08e296d..3789cc9171 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/grid/WQuickEntry.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/grid/WQuickEntry.java @@ -18,7 +18,6 @@ import java.util.ArrayList; import java.util.List; import java.util.logging.Level; -import org.adempiere.base.Core; import org.adempiere.webui.ClientInfo; import org.adempiere.webui.component.ConfirmPanel; import org.adempiere.webui.component.Label; @@ -34,6 +33,7 @@ import org.adempiere.webui.util.ZKUpdateUtil; import org.adempiere.webui.window.FDialog; import org.compiere.model.GridField; import org.compiere.model.GridTab; +import org.compiere.model.GridTable; import org.compiere.model.GridWindow; import org.compiere.model.MField; import org.compiere.model.MLookup; @@ -66,7 +66,7 @@ public class WQuickEntry extends Window implements EventListener, ValueCh /** * */ - private static final long serialVersionUID = -8530102231615195037L; + private static final long serialVersionUID = -1397302187339942732L; public static final String QUICK_ENTRY_MODE = "_QUICK_ENTRY_MODE_"; public static final String QUICK_ENTRY_CALLER_WINDOW = "_QUICK_ENTRY_CALLER_WINDOW_"; @@ -532,12 +532,16 @@ public class WQuickEntry extends Window implements EventListener, ValueCh WEditor editor = quickEditors.get(idx); GridTab gridTab = field.getGridTab(); String columnName = field.getColumnName(); + GridTable mTable = gridTab.getTableModel(); + int row = gridTab.getCurrentRow(); + int col = mTable.findColumn(columnName); // process dependencies and callouts for the changed field if (evt.getSource() instanceof WLocationEditor && evt.getNewValue() == null && editor.getValue() != null) { // ignore first call of WLocationEditor valuechange set to null // it will be called later with correct value // see WLocationEditor firing twice ValueChangeEvent (first with null and then with value) } else { + mTable.setValueAt(evt.getNewValue(), row, col); field.setValue(evt.getNewValue(), field.getGridTab().getTableModel().isInserting()); gridTab.processFieldChange(field); } @@ -555,12 +559,8 @@ public class WQuickEntry extends Window implements EventListener, ValueCh mLookup.refresh(); } } - } // for all dependent fields - if ( dependants.size() > 0 - || field.getCallout().length() > 0 - || Core.findCallout(gridTab.getTableName(), columnName).size() > 0) { - dynamicDisplay(); - } + } + dynamicDisplay(); } } } @@ -572,8 +572,13 @@ public class WQuickEntry extends Window implements EventListener, ValueCh { for (int idxf = 0; idxf < quickFields.size(); idxf++) { GridField field = quickFields.get(idxf); + GridTab gridTab = field.getGridTab(); + String columnName = field.getColumnName(); + GridTable mTable = gridTab.getTableModel(); + int row = gridTab.getCurrentRow(); + int col = mTable.findColumn(columnName); WEditor editor = quickEditors.get(idxf); - editor.setValue(field.getValue()); + editor.setValue(mTable.getValueAt(row, col)); //In case a callout changed the value and it is not reflected in field yet editor.setReadWrite(field.isEditable(true)); editor.setVisible(field.isDisplayed(true)); }