Project

General

Profile

« Previous | Next » 

Revision 13d24007

Added by Andreas Kohlbecker about 6 years ago

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

View differences:

src/main/java/eu/etaxonomy/cdm/vaadin/view/name/NameTypeDesignationPresenter.java
262 262

  
263 263
        if(event.getPopup() == typeNamePopup){
264 264
            if(event.getReason() == Reason.SAVE){
265
                getCache().load(typeNamePopup.getBean());
265 266
                getView().getTypeNameField().reload();
266 267
            }
267 268
            if(event.getReason() == Reason.DELETE){
src/main/java/eu/etaxonomy/cdm/vaadin/view/name/TaxonNameEditorPresenter.java
332 332
        if(event.getPopup() == referenceEditorPopup){
333 333
            if(event.getReason() == Reason.SAVE){
334 334

  
335
                Reference modifiedReference = referenceEditorPopup.getBean();
336

  
337
                // the bean contained in the popup editor is not yet updated at this point.
338
                // so re reload it using the uuid since new beans might not have an Id at this point.
339
                // modifiedReference = getRepo().getReferenceService().load(modifiedReference.getUuid(), Arrays.asList("inReference"));
335
                getCache().load(referenceEditorPopup.getBean());
340 336
                getView().getNomReferenceCombobox().reload(); // refreshSelectedValue(modifiedReference);
341

  
337
                getView().getCombinationAuthorshipField().discard(); //refresh from the datasource
338
                getView().updateAuthorshipFields();
342 339
            }
343 340

  
344 341
            referenceEditorPopup = null;
345 342
        }
346 343
        if(event.getPopup() == basionymNamePopup){
347 344
            if(event.getReason() == Reason.SAVE){
348
                // TaxonName modifiedTaxonName = basionymNamePopup.getBean();
349
                // modifiedTaxonName = getRepo().getNameService().load(modifiedTaxonName.getUuid(), BASIONYM_INIT_STRATEGY);
345

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

  
353 352
            }
src/main/java/eu/etaxonomy/cdm/vaadin/view/occurrence/CollectionEditorPresenter.java
140 140
            if(event.getReason() == Reason.SAVE){
141 141

  
142 142
                Collection newCollection = collectionPopuEditor.getBean();
143

  
144
                // TODO the bean contained in the popup editor is not yet updated at this point.
145
                //      so re reload it using the uuid since new beans will not have an Id at this point.
146
                newCollection = getRepo().getCollectionService().find(newCollection.getUuid());
143
                getCache().load(newCollection);
147 144
                getView().getSuperCollectionCombobox().getSelect().setValue(newCollection);
148 145
            }
149 146

  
src/main/java/eu/etaxonomy/cdm/vaadin/view/reference/ReferenceEditorPresenter.java
161 161
   }
162 162

  
163 163
   @EventBusListenerMethod
164
   public void doDoneWithPopupEvent(DoneWithPopupEvent event){
164
   public void onDoneWithPopupEvent(DoneWithPopupEvent event){
165 165

  
166 166
       if(event.getPopup().equals(inReferencePopup)){
167 167
           if(event.getReason().equals(Reason.SAVE)){
168
               Reference bean = inReferencePopup.getBean();
168
               getCache().load(inReferencePopup.getBean());
169 169
               getView().getInReferenceCombobox().reload(); //refreshSelectedValue(bean);
170 170
           }
171 171
           if(event.getReason().equals(Reason.DELETE)){

Also available in: Unified diff