Actions
task #7479
openconsider a cleaner implementation of adaptive reference field visibility
Start date:
Due date:
% Done:
0%
Estimated time:
Severity:
normal
Description
in turn of implementing #7223 the ReferencePropertyDefinitions
have been created which has the potential to help implementing a clean field visibility control for the taxeditor.
The code to adapt the field visibilioty in the vaadin reference editor may be useful as a inspiration for the taxeditor:
try {
Map<String, String> fieldPropertyDefinition = ReferencePropertyDefinitions.fieldPropertyDefinition(value);
setAllFieldsVisible(false);
for(String fieldName : fieldPropertyDefinition.keySet()){
Field<?> field = getField(fieldName);
if(field == null){
continue;
}
field.setVisible(true);
String propertyName = fieldPropertyDefinition.get(fieldName);
if(propertyName != fieldName){
field.setCaption(propertyNameLabelMap.get(propertyName));
}
}
} catch (UnimplemetedCaseException e) {
logger.error(e);
// enable all fields
setAllFieldsVisible(true);
// fix inReference label
getField("inReference").setCaption(propertyNameLabelMap.get("inReference"));
}
Related issues
Updated by Andreas Kohlbecker almost 6 years ago
- Related to bug #7223: ReferenceEditor: disable fields depending on the Reference type added
Updated by Andreas Müller almost 4 years ago
- Assignee changed from Patrick Plitzner to Katja Luther
Actions