refreshing RegistrationWorkingsetPresenter on popup editor close
[cdm-vaadin.git] / src / main / java / eu / etaxonomy / cdm / vaadin / view / registration / RegistrationWorkingsetPresenter.java
index 01b098fba276de5164553df3604e2118b045cf24..c5f524701b9e95f890441bde17dcfc4ba0fb2639 100644 (file)
@@ -210,6 +210,7 @@ public class RegistrationWorkingsetPresenter extends AbstractPresenter<Registrat
         }
 
         ReferencePopupEditor popup = getNavigationManager().showInPopup(ReferencePopupEditor.class);
+        popup.withReferenceTypes(RegistrationUIDefaults.PRINTPUB_REFERENCE_TYPES);
         popup.loadInEditor(null);
     }
 
@@ -220,10 +221,29 @@ public class RegistrationWorkingsetPresenter extends AbstractPresenter<Registrat
             return;
         }
         ReferencePopupEditor popup = getNavigationManager().showInPopup(ReferencePopupEditor.class);
+        popup.withReferenceTypes(RegistrationUIDefaults.PRINTPUB_REFERENCE_TYPES);
         popup.withDeleteButton(true);
         popup.loadInEditor(event.getEntityId());
     }
 
+    @EventListener
+    public void onDoneWithReferencePopupEditor(DoneWithPopupEvent event) throws RegistrationValidationException{
+        if(event.getPopup() instanceof ReferencePopupEditor){
+            if(event.getReason().equals(Reason.SAVE)){
+                refreshView(true);
+            }
+        }
+    }
+
+    @EventListener
+    public void onDoneWithSpecimenTypeDesignationWorkingsetPopupEditor(DoneWithPopupEvent event) throws RegistrationValidationException{
+        if(event.getPopup() instanceof SpecimenTypeDesignationWorkingsetPopupEditor){
+            if(event.getReason().equals(Reason.SAVE)){
+                refreshView(true);
+            }
+        }
+    }
+
     @EventListener(condition = "#event.type == T(eu.etaxonomy.vaadin.event.EditorActionType).EDIT")
     public void onRegistrationEditorAction(RegistrationEditorAction event) {