Project

General

Profile

task #7479

consider a cleaner implementation of adaptive reference field visibility

Added by Andreas Kohlbecker 9 months ago.

Status:
New
Priority:
New
Category:
taxeditor
Target version:
Start date:
06/15/2018
Due date:
% Done:

0%

Severity:
normal

Description

in turn of implementing #7223 the ReferencePropertyDefinitionshave 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

Related to Edit - bug #7223: ReferenceEditor: disable fields depending on the Reference type Resolved 01/26/2018

History

#1 Updated by Andreas Kohlbecker 9 months ago

  • Related to bug #7223: ReferenceEditor: disable fields depending on the Reference type added

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 40 MB)