Project

General

Profile

« Previous | Next » 

Revision bbdd609f

Added by Andreas Kohlbecker over 3 years ago

fix #7586 temporarily setting the datasource readOnly state to false when relpacing the loaded with the cached entity

View differences:

src/main/java/eu/etaxonomy/cdm/vaadin/event/ToOneRelatedEntityReloader.java
80 80
                        ((EntitySupport)toOneRelatedEntityField).replaceEntityValue(cachedEntity);
81 81
                    } else {
82 82
                        toOneRelatedEntityField.removeValueChangeListener(this);
83
                        // TODO it would be better to add this as ValueChangeListener to the PropertyDataSource directly instead of listenting at the Field
84
                        boolean readOnly = toOneRelatedEntityField.getPropertyDataSource().isReadOnly();
85
                        toOneRelatedEntityField.getPropertyDataSource().setReadOnly(false);
83 86
                        toOneRelatedEntityField.setValue(null); // reset to trick equals check in vaadin
84 87
                        toOneRelatedEntityField.setValue(cachedEntity);
88
                        toOneRelatedEntityField.getPropertyDataSource().setReadOnly(readOnly);
85 89
                        toOneRelatedEntityField.addValueChangeListener(this);
86 90
                    }
87 91
                    onSettingReloadedEntity = false;

Also available in: Unified diff