ref #9838: change order of ui element creation and setting entity in collection elements
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / section / occurrence / SpecimenCollectionDetailElement.java
index 4eae4d1e4ddf6735b1bf01511e4ecfc6acc64c7b..0536a1896321766e093f47b90125d36b2e5f0285 100644 (file)
@@ -67,7 +67,9 @@ public class SpecimenCollectionDetailElement extends
        @Override
        public void setEntity(DerivedUnit entity) {
                this.entity = entity;
-               selection_derivedUnit.setEntity(entity);
+               if (selection_derivedUnit != null){
+                       selection_derivedUnit.setEntity(entity);
+               }
        }
 
        /*
@@ -84,6 +86,9 @@ public class SpecimenCollectionDetailElement extends
                                .createSelectionElement(DerivedUnit.class,//getConversationHolder(),
                                        element, "Derived Unit", null,
                                                EntitySelectionElement.EDITABLE | EntitySelectionElement.SELECTABLE, style);
+               if (entity != null){
+                       setEntity(entity);
+               }
        }
 
        /*