IDEMPIERE-3905 Set label in red when editor is mandatory and empty on quick entry panels

This commit is contained in:
Carlos Ruiz 2019-02-28 22:42:13 +01:00
parent 0a5f31f2f1
commit bb8aedc027
1 changed files with 14 additions and 3 deletions

View File

@ -357,6 +357,7 @@ public class WQuickEntry extends Window implements EventListener<Event>, ValueCh
initialValues.add(editor.getValue()); initialValues.add(editor.getValue());
} }
dynamicDisplay(); dynamicDisplay();
updateStyleTab(quickTabs.get(0));
return true; return true;
} }
@ -376,13 +377,12 @@ public class WQuickEntry extends Window implements EventListener<Event>, ValueCh
if (value != null) { if (value != null) {
editor.setValue(value); editor.setValue(value);
field.setValue(value, false); field.setValue(value, false);
} else {
editor.dynamicDisplay();
} }
initialValues.add(editor.getValue()); initialValues.add(editor.getValue());
} }
dynamicDisplay(); dynamicDisplay();
updateStyleTab(quickTabs.get(0));
return true; return true;
} // loadRecord } // loadRecord
@ -571,6 +571,7 @@ public class WQuickEntry extends Window implements EventListener<Event>, ValueCh
} }
} }
dynamicDisplay(); dynamicDisplay();
updateStyleTab(gridTab);
} }
} }
} }
@ -591,10 +592,20 @@ public class WQuickEntry extends Window implements EventListener<Event>, ValueCh
editor.setValue(mTable.getValueAt(row, col)); //In case a callout changed the value and it is not reflected in field yet 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.setReadWrite(field.isEditable(true));
editor.setVisible(field.isDisplayed(true)); editor.setVisible(field.isDisplayed(true));
editor.updateStyle();
} }
} // dynamicDisplay } // dynamicDisplay
private void updateStyleTab(GridTab tab) {
for (int idxf = 0; idxf < quickFields.size(); idxf++) {
GridField field = quickFields.get(idxf);
GridTab gridTab = field.getGridTab();
if (tab == gridTab) {
WEditor editor = quickEditors.get(idxf);
editor.updateStyle();
}
}
}
/** /**
* get size quickfields * get size quickfields
*/ */