IDEMPIERE-3421 wtable dir editor load wrong list

This commit is contained in:
Carlos Ruiz 2017-07-04 12:42:55 +02:00
parent b0f7cda146
commit a2150cf29f
3 changed files with 9 additions and 17 deletions

View File

@ -744,10 +744,12 @@ DataStatusListener, IADTabpanel, IdSpace, IFieldEditorContainer
} }
else else
{ {
comp.dynamicDisplay();
boolean rw = mField.isEditable(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.setReadWrite(rw);
comp.setMandatory(mField.isMandatory(true)); // check context comp.setMandatory(mField.isMandatory(true)); // check context
comp.dynamicDisplay();
} }
} }
else if (comp.isVisible()) else if (comp.isVisible())

View File

@ -996,9 +996,12 @@ public class GridView extends Vbox implements EventListener<Event>, IdSpace, IFi
} }
else else
{ {
comp.dynamicDisplay(); boolean rw = mField.isEditable(true); // r/w - check Context
boolean rw = mField.isEditableGrid(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.setReadWrite(rw);
comp.setMandatory(mField.isMandatory(true)); // check context
comp.dynamicDisplay();
} }
Properties ctx = isDetailPane() ? new GridRowCtx(Env.getCtx(), gridTab, gridTab.getCurrentRow()) Properties ctx = isDetailPane() ? new GridRowCtx(Env.getCtx(), gridTab, gridTab.getCurrentRow())

View File

@ -93,8 +93,6 @@ public abstract class WEditor implements EventListener<Event>, PropertyChangeLis
private boolean readOnly; private boolean readOnly;
private boolean updateable;
private String columnName; private String columnName;
protected WEditorPopupMenu popupMenu; protected WEditorPopupMenu popupMenu;
@ -177,7 +175,6 @@ public abstract class WEditor implements EventListener<Event>, PropertyChangeLis
this.setMandatory(gridField.isMandatory(true)); this.setMandatory(gridField.isMandatory(true));
this.readOnly = gridField.isReadOnly(); this.readOnly = gridField.isReadOnly();
this.description = gridField.getDescription(); this.description = gridField.getDescription();
this.updateable = gridField.isUpdateable();
this.columnName = gridField.getColumnName(); this.columnName = gridField.getColumnName();
this.strLabel = gridField.getHeader(); this.strLabel = gridField.getHeader();
init(); init();
@ -227,7 +224,6 @@ public abstract class WEditor implements EventListener<Event>, PropertyChangeLis
this.setMandatory(mandatory); this.setMandatory(mandatory);
this.readOnly = readonly; this.readOnly = readonly;
this.description = description; this.description = description;
this.updateable = updateable;
this.strLabel = label; this.strLabel = label;
init(); init();
} }
@ -253,7 +249,6 @@ public abstract class WEditor implements EventListener<Event>, PropertyChangeLis
this.setMandatory(mandatory); this.setMandatory(mandatory);
this.readOnly = readonly; this.readOnly = readonly;
this.description = description; this.description = description;
this.updateable = updateable;
this.strLabel = label; this.strLabel = label;
this.columnName = columnName; this.columnName = columnName;
init(); init();
@ -277,15 +272,7 @@ public abstract class WEditor implements EventListener<Event>, PropertyChangeLis
label.setMandatory(mandatory); label.setMandatory(mandatory);
this.setMandatory (mandatory); this.setMandatory (mandatory);
this.setReadWrite(!readOnly);
if (readOnly || !updateable)
{
this.setReadWrite(false);
}
else
{
this.setReadWrite(true);
}
((HtmlBasedComponent)component).setTooltiptext(description); ((HtmlBasedComponent)component).setTooltiptext(description);
label.setTooltiptext(description); label.setTooltiptext(description);