Project

General

Profile

« Previous | Next » 

Revision e5e64d18

Added by Andreas Kohlbecker about 6 years ago

ref #7344 updating presenter entity caches with beans modified in popup editors and refreshing teamOrPerson Fields (2)

  • adding entity as field to EntityChangeEvent
  • replacing all onDoneWithEditor listener methods by according onEntityChangeEvent methods

View differences:

src/main/java/eu/etaxonomy/cdm/vaadin/view/name/TaxonNameEditorPresenter.java
38 38
import eu.etaxonomy.cdm.service.CdmFilterablePagingProvider;
39 39
import eu.etaxonomy.cdm.vaadin.component.CdmBeanItemContainerFactory;
40 40
import eu.etaxonomy.cdm.vaadin.event.EditorActionTypeFilter;
41
import eu.etaxonomy.cdm.vaadin.event.EntityChangeEvent;
41 42
import eu.etaxonomy.cdm.vaadin.event.ReferenceEditorAction;
42 43
import eu.etaxonomy.cdm.vaadin.event.TaxonNameEditorAction;
43 44
import eu.etaxonomy.cdm.vaadin.event.ToOneRelatedEntityButtonUpdater;
......
49 50
import eu.etaxonomy.vaadin.component.ReloadableSelect;
50 51
import eu.etaxonomy.vaadin.mvp.AbstractCdmEditorPresenter;
51 52
import eu.etaxonomy.vaadin.mvp.BeanInstantiator;
52
import eu.etaxonomy.vaadin.ui.view.DoneWithPopupEvent;
53
import eu.etaxonomy.vaadin.ui.view.DoneWithPopupEvent.Reason;
54 53

  
55 54
/**
56 55
 * @author a.kohlbecker
......
327 326
    }
328 327

  
329 328
    @EventBusListenerMethod
330
    public void onDoneWithPopupEvent(DoneWithPopupEvent event){
329
    public void onEntityChangeEvent(EntityChangeEvent<?> event){
331 330

  
332
        if(event.getPopup() == referenceEditorPopup){
333
            if(event.getReason() == Reason.SAVE){
331
        if(event.getSourceView() == referenceEditorPopup){
332
            if(event.isCreateOrModifiedType()){
334 333

  
335
                getCache().load(referenceEditorPopup.getBean());
334
                getCache().load(event.getEntity());
336 335
                getView().getNomReferenceCombobox().reload(); // refreshSelectedValue(modifiedReference);
337 336
                getView().getCombinationAuthorshipField().discard(); //refresh from the datasource
338 337
                getView().updateAuthorshipFields();
......
340 339

  
341 340
            referenceEditorPopup = null;
342 341
        }
343
        if(event.getPopup() == basionymNamePopup){
344
            if(event.getReason() == Reason.SAVE){
342
        if(event.getSourceView()  == basionymNamePopup){
343
            if(event.isCreateOrModifiedType()){
345 344

  
346
                getCache().load(basionymNamePopup.getBean());
345
                getCache().load(event.getEntity());
347 346
                ((ReloadableSelect)basionymSourceField).reload();
348 347
                getView().getBasionymAuthorshipField().discard(); //refresh from the datasource
349 348
                getView().getExBasionymAuthorshipField().discard(); //refresh from the datasource
350 349
                getView().updateAuthorshipFields();
351 350

  
352 351
            }
353
            if(event.getReason() == Reason.DELETE){
352
            if(event.isRemovedType()){
354 353
                basionymSourceField.setValue(null);
354
                getView().updateAuthorshipFields();
355 355
            }
356 356

  
357 357
            basionymNamePopup = null;

Also available in: Unified diff