Project

General

Profile

« Previous | Next » 

Revision 9361ce64

Added by Andreas Kohlbecker almost 6 years ago

fix #7524 replacing uninomial field on rank change

View differences:

src/main/java/eu/etaxonomy/cdm/vaadin/view/name/TaxonNamePopupEditor.java
137 137

  
138 138
    private AnnotationType[] editableAnotationTypes = RegistrationUIDefaults.EDITABLE_ANOTATION_TYPES;
139 139

  
140
    private int genusOrUninomialRow;
141

  
140 142
    /**
141 143
     * By default  AnnotationType.EDITORIAL() is enabled.
142 144
     *
......
301 303
        protectedNameCacheField = addSwitchableTextField("Name cache", "nameCache", "protectedNameCache", 0, row, GRID_COLS-1, row);
302 304
        protectedNameCacheField.setWidth(100, Unit.PERCENTAGE);
303 305
        row++;
304
        if(isModeEnabled(TaxonNamePopupEditorMode.VALIDATE_AGAINST_HIGHER_NAME_PART)){
305
            genusOrUninomialField = addTextField("Genus or uninomial", "genusOrUninomial", 0, row, 1, row);
306
        } else {
307
            genusOrUninomialField = new LazyComboBox<String>(String.class);
308
            addField(genusOrUninomialField, "genusOrUninomial", 0, row, 1, row);
309
        }
306
        genusOrUninomialRow = row;
307
        genusOrUninomialField = addTextField("Genus or uninomial", "genusOrUninomial", 0, row, 1, row);
310 308
        genusOrUninomialField.setWidth(200, Unit.PIXELS);
311 309
        infraGenericEpithetField = addTextField("Infrageneric epithet", "infraGenericEpithet", 2, row, 3, row);
312 310
        infraGenericEpithetField.setWidth(200, Unit.PIXELS);
......
702 700
        Boolean withBasionymSection = BooleanUtils.isTrue(basionymToggle.getValue());
703 701
        Boolean withValidationSection = isSpeciesOrBelow && BooleanUtils.isTrue(validationToggle.getValue());
704 702

  
703
        if(isModeEnabled(TaxonNamePopupEditorMode.VALIDATE_AGAINST_HIGHER_NAME_PART)){
704
            if(isSpeciesOrBelow) {
705
                if(TextField.class.isAssignableFrom(genusOrUninomialField.getClass())){
706
                    genusOrUninomialField = replaceComponent("genusOrUninomial", genusOrUninomialField, new LazyComboBox<String>(String.class), 0, genusOrUninomialRow, 1, genusOrUninomialRow);
707
                }
708
            } else {
709
                if(LazyComboBox.class.isAssignableFrom(genusOrUninomialField.getClass())) {
710
                    genusOrUninomialField = replaceComponent("genusOrUninomial", genusOrUninomialField, new TextFieldNFix(), 0, genusOrUninomialRow, 1, genusOrUninomialRow);
711
                }
712
            }
713
        }
714

  
705 715
        if(isModeEnabled(TaxonNamePopupEditorMode.VALIDATE_AGAINST_HIGHER_NAME_PART)){
706 716
            if(rank.isInfraSpecific()) {
707 717
                if(TextField.class.isAssignableFrom(specificEpithetField.getClass())) {

Also available in: Unified diff