Project

General

Profile

Actions

task #7479

open

consider a cleaner implementation of adaptive reference field visibility

Added by Andreas Kohlbecker almost 6 years ago. Updated almost 4 years ago.

Status:
New
Priority:
New
Assignee:
Category:
taxeditor
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
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 ClosedAndreas Kohlbecker

Actions
Actions #1

Updated by Andreas Kohlbecker almost 6 years ago

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

Updated by Andreas Müller almost 4 years ago

  • Assignee changed from Patrick Plitzner to Katja Luther
Actions

Also available in: Atom PDF