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 / name / NomenclaturalStatusElement.java
index 4350da8ac57bbbbfbcc26ff1ec9c4768076eb192..f149afb69a40b4a9d812ccb8cc74a2754d4cb563 100644 (file)
@@ -91,6 +91,9 @@ public class NomenclaturalStatusElement extends AbstractSourcedEntityElement<Nom
         spacer.getLayoutComposite().setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
         addElement(spacer);
                super.createControls(element, style);
+               if (entity != null){
+                       setEntity(entity);
+               }
 
 
        }
@@ -99,12 +102,14 @@ public class NomenclaturalStatusElement extends AbstractSourcedEntityElement<Nom
        @Override
        public void setEntity(NomenclaturalStatus entity) {
                super.setEntity(entity);
-               if (entity.getType() != null){
-                   nomenclaturalStatusTypeCombo.setSelection(entity.getType());
-                   nomenclaturalStatusTypeCombo.removeEmptyElement();
-               }
-               if (ruleConsidered != null){
-                   ruleConsidered.setElement(entity);
+               if (nomenclaturalStatusTypeCombo != null){
+                       if (entity.getType() != null){
+                           nomenclaturalStatusTypeCombo.setSelection(entity.getType());
+                           nomenclaturalStatusTypeCombo.removeEmptyElement();
+                       }
+                       if (ruleConsidered != null){
+                           ruleConsidered.setElement(entity);
+                       }
                }
        }