Fix refresh problem when creating a FieldUnit with no previous viewer
authorPatrick Plitzner <p.plitzner@bgbm.org>
Tue, 1 Dec 2015 14:49:41 +0000 (15:49 +0100)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Wed, 2 Dec 2015 10:09:38 +0000 (11:09 +0100)
content

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/DerivateView.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/contextMenu/CreateFieldUnitContextMenu.java

index 0d587c2..811c1e3 100644 (file)
@@ -231,13 +231,13 @@ public class DerivateView extends EditorPart implements IPartContentHasFactualDa
                 cdmEntitySession.bind();
             }
 
+            List<SpecimenOrObservationBase> derivates = null;
             if(derivativeUuids!=null){
                 this.derivateToRootEntityMap = new HashMap<SpecimenOrObservationBase<?>, SpecimenOrObservationBase<?>>();
                 this.rootElements = new HashSet<SpecimenOrObservationBase<?>>();
-                List<SpecimenOrObservationBase> derivates =
-                        CdmStore.getService(IOccurrenceService.class).load(new ArrayList(derivativeUuids), SPECIMEN_INIT_STRATEGY);
-                updateRootEntities(derivates);
+                derivates = CdmStore.getService(IOccurrenceService.class).load(new ArrayList(derivativeUuids), SPECIMEN_INIT_STRATEGY);
             }
+            updateRootEntities(derivates);
             refreshTree(false);
             previousCdmEntitySession.bind();
         }
index 48c38c8..dc3176b 100644 (file)
@@ -89,7 +89,7 @@ public class CreateFieldUnitContextMenu extends CompoundContributionItem {
                                         fieldUnit = CdmBase.deproxy(CdmStore.getService(IOccurrenceService.class).save(fieldUnit), FieldUnit.class);
                                         derivateView.getConversationHolder().commit();
                                         derivateView.addFieldUnit(fieldUnit);
-                                        derivateView.refreshTree();
+                                        derivateView.updateRootEntities();
                                     }
                                 });
                             }