Project

General

Profile

Revision 7fa05bfe

ID7fa05bfeea2e877355108e007d282a4dc4fe3c3c
Parent 761df07f
Child d34cd38e

Added by Andreas Kohlbecker over 3 years ago

ref #7338 fixing bugs related to VALIDATE_AGAINST_HIGHER_NAME_PART mode:
- NPE when switching to intraSpecific rank with two name editors open
- ConncurrentModification problem when canceling editor

View differences:

src/main/java/eu/etaxonomy/cdm/vaadin/view/name/TaxonNameEditorPresenter.java
310 310
    public void onReferenceEditorActionEdit(ReferenceEditorAction event) {
311 311

  
312 312

  
313
        if(getView() == null || event.getSourceView() != getView() ){
313
        if(!isFromOwnView(event)){
314 314
            return;
315 315
        }
316 316
        ReferencePopupEditor referenceEditorPopup = openPopupEditor(ReferencePopupEditor.class, event);
......
330 330
    public void onFieldReplaceEvent(FieldReplaceEvent<String> event){
331 331

  
332 332
        PropertyIdPath boundPropertyIdPath = boundPropertyIdPath(event.getNewField());
333
        if(boundPropertyIdPath.matches("specificEpithet")){
333
        if(boundPropertyIdPath != null && boundPropertyIdPath.matches("specificEpithet")){
334 334
            if(event.getNewField() instanceof LazyComboBox){
335 335

  
336 336
                if(specificEpithetPartPagingProvider  == null){
src/main/java/eu/etaxonomy/cdm/vaadin/view/name/TaxonNamePopupEditor.java
127 127

  
128 128
    private int specificEpithetFieldRow;
129 129

  
130
    private ValueChangeListener updateFieldVisibilityListener = e -> updateFieldVisibility();
131

  
130 132
    /**
131 133
     * @param layout
132 134
     * @param dtoType
......
484 486
    protected void afterItemDataSourceSet() {
485 487

  
486 488

  
487
        rankSelect.addValueChangeListener(e -> updateFieldVisibility());
489
        rankSelect.addValueChangeListener(updateFieldVisibilityListener);
488 490
        basionymToggle.addValueChangeListener(e -> {
489 491
            updateAuthorshipFields();
490 492
        });
......
707 709
    @Override
708 710
    public void cancel() {
709 711
        authorshipUpdateListeners.keySet().forEach(field -> field.removeValueChangeListener(authorshipUpdateListeners.get(field)));
712
        rankSelect.removeValueChangeListener(updateFieldVisibilityListener);
710 713
        super.cancel();
711 714
    }
712 715

  
src/main/java/eu/etaxonomy/vaadin/mvp/AbstractEditorPresenter.java
16 16
import com.vaadin.ui.Field;
17 17

  
18 18
import eu.etaxonomy.cdm.vaadin.event.AbstractEditorAction;
19
import eu.etaxonomy.vaadin.event.FieldReplaceEvent;
19 20
import eu.etaxonomy.vaadin.mvp.event.EditorDeleteEvent;
20 21
import eu.etaxonomy.vaadin.mvp.event.EditorPreSaveEvent;
21 22
import eu.etaxonomy.vaadin.mvp.event.EditorSaveEvent;
......
112 113
        return action.getSourceView() != null && getView().equals(action.getSourceView());
113 114
    }
114 115

  
116
    protected boolean isFromOwnView(FieldReplaceEvent event){
117
        return event.getSourceView() != null && getView().equals(event.getSourceView());
118
    }
115 119

  
116 120
    protected abstract void saveBean(DTO bean);
117 121

  

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)