From a2150cf29f1f282247a0d1c19e5fa8e08df11bb2 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 4 Jul 2017 12:42:55 +0200 Subject: [PATCH] IDEMPIERE-3421 wtable dir editor load wrong list --- .../org/adempiere/webui/adwindow/ADTabpanel.java | 4 +++- .../org/adempiere/webui/adwindow/GridView.java | 7 +++++-- .../src/org/adempiere/webui/editor/WEditor.java | 15 +-------------- 3 files changed, 9 insertions(+), 17 deletions(-) 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 cee0191f0f..cc810683ef 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 @@ -744,10 +744,12 @@ DataStatusListener, IADTabpanel, IdSpace, IFieldEditorContainer } else { - comp.dynamicDisplay(); boolean rw = mField.isEditable(true); // r/w - check Context + if (rw && !comp.isReadWrite()) // IDEMPIERE-3421 - if it was read-only the list can contain direct values + mField.refreshLookup(); comp.setReadWrite(rw); comp.setMandatory(mField.isMandatory(true)); // check context + comp.dynamicDisplay(); } } else if (comp.isVisible()) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridView.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridView.java index 292461fb42..cf32df5eb3 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridView.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridView.java @@ -996,9 +996,12 @@ public class GridView extends Vbox implements EventListener, IdSpace, IFi } else { - comp.dynamicDisplay(); - boolean rw = mField.isEditableGrid(true); // r/w - check Context + boolean rw = mField.isEditable(true); // r/w - check Context + if (rw && !comp.isReadWrite()) // IDEMPIERE-3421 - if it was read-only the list can contain direct values + mField.refreshLookup(); comp.setReadWrite(rw); + comp.setMandatory(mField.isMandatory(true)); // check context + comp.dynamicDisplay(); } Properties ctx = isDetailPane() ? new GridRowCtx(Env.getCtx(), gridTab, gridTab.getCurrentRow()) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WEditor.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WEditor.java index 42b5877001..524855ef94 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WEditor.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WEditor.java @@ -93,8 +93,6 @@ public abstract class WEditor implements EventListener, PropertyChangeLis private boolean readOnly; - private boolean updateable; - private String columnName; protected WEditorPopupMenu popupMenu; @@ -177,7 +175,6 @@ public abstract class WEditor implements EventListener, PropertyChangeLis this.setMandatory(gridField.isMandatory(true)); this.readOnly = gridField.isReadOnly(); this.description = gridField.getDescription(); - this.updateable = gridField.isUpdateable(); this.columnName = gridField.getColumnName(); this.strLabel = gridField.getHeader(); init(); @@ -227,7 +224,6 @@ public abstract class WEditor implements EventListener, PropertyChangeLis this.setMandatory(mandatory); this.readOnly = readonly; this.description = description; - this.updateable = updateable; this.strLabel = label; init(); } @@ -253,7 +249,6 @@ public abstract class WEditor implements EventListener, PropertyChangeLis this.setMandatory(mandatory); this.readOnly = readonly; this.description = description; - this.updateable = updateable; this.strLabel = label; this.columnName = columnName; init(); @@ -277,15 +272,7 @@ public abstract class WEditor implements EventListener, PropertyChangeLis label.setMandatory(mandatory); this.setMandatory (mandatory); - - if (readOnly || !updateable) - { - this.setReadWrite(false); - } - else - { - this.setReadWrite(true); - } + this.setReadWrite(!readOnly); ((HtmlBasedComponent)component).setTooltiptext(description); label.setTooltiptext(description);