Project

General

Profile

Revision 0ce0edd2

ID0ce0edd2d72acd2fc4c08614edc9bdd898b65a95
Parent 12f80804
Child 3b4bcfb5

Added by Andreas Kohlbecker over 2 years ago

ref #7349 prevent from setting nbew persons as value to person select - fixes problem with person fields being mixed up

View differences:

src/main/java/eu/etaxonomy/cdm/vaadin/component/common/PersonField.java
115 115
            personSelect.clear();
116 116
        });
117 117
        selectOrNewContainer.addComponents(personSelect, personSelectConfirmButton, newPersonButton);
118
        newPersonButton.addClickListener(e -> {
119
            setValue(Person.NewInstance());
120
        });
118
        newPersonButton.addClickListener(e -> createNewPerson());
121 119

  
122 120
        // edit person
123 121
        addStyledComponent(titleCacheField);
......
271 269
        return Person.class;
272 270
    }
273 271

  
272
    private void createNewPerson(){
273
        Person p = Person.NewInstance();
274
        setValue(p);
275
    }
276

  
274 277
    @Override
275 278
    public void setValue(Person person){
276 279
        super.setValue(person);
277
//        PersonFieldAccess personWrapper = new PersonFieldAccess(person);
278
//        super.setValue(personWrapper);
279
        personSelect.setValue(person);
280
        if(person != null && person.getId() != 0){
281
            personSelect.setValue(person);
282
        }
280 283
    }
281 284

  
282 285
    /**

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)