From 6b9b4814e715abe93c7db42f03ffd486994cde99 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 8 Mar 2011 10:46:14 -0500 Subject: [PATCH] Fix zkwebui problem with mandatory read-only fields. There is a case where a read-only field is set as mandatory (it's filled with a default value) - this is working ok in swing, but in zkwebui was not working because read-only fields were treated in a different way ---------------------- Fix problem caused by revision 14423: http://adempiere.svn.sourceforge.net/viewvc/adempiere?view=revision&revision=14423 Problem reported here: https://sourceforge.net/projects/adempiere/forums/forum/610548/topic/3958171 * Fix zkwebui problem with mandatory read-only fields. * Now it behaves like swing * And lists are not filled for read-only fields (better performance) --- .../WEB-INF/src/org/adempiere/webui/editor/WEditor.java | 2 +- .../WEB-INF/src/org/adempiere/webui/editor/WTableDirEditor.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 57f7dc1db4..4e40378b68 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 @@ -432,7 +432,7 @@ public abstract class WEditor implements EventListener, PropertyChangeListener { this.mandatory = mandatory; if (label != null) - label.setMandatory(mandatory && isReadWrite()); + label.setMandatory(mandatory); } /** diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WTableDirEditor.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WTableDirEditor.java index 73cba4b739..9cb446eceb 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WTableDirEditor.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WTableDirEditor.java @@ -197,7 +197,7 @@ ContextMenuListener, IZoomableEditor //still not in list, reset to zero if (!getComponent().isSelected(value)) { - if (value instanceof Integer && (Integer)value == 0) + if (value instanceof Integer && gridField.getDisplayType() != DisplayType.ID) // for IDs is ok to be out of the list { getComponent().setValue(null); if (curValue == null)