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 / supplemental / AnnotationElement.java
index 3a29ac01bcd28f96092049f5105b5793fb2aa09d..cdae59ecde06909a3c854c82b30c2851b3c8b935 100644 (file)
@@ -43,13 +43,18 @@ public class AnnotationElement extends AbstractEntityCollectionElement<Annotatio
                combo_annotationType = formFactory.createDefinedTermComboElement(TermType.AnnotationType, this, "Annotation Type", null, style);
 
                text = formFactory.createMultiLineTextWithLabel(this, "Annotation", 100, style);
+               if (entity != null){
+                       setEntity(entity);
+               }
        }
 
        @Override
        public void setEntity(Annotation entity) {
                this.entity = entity;
-               combo_annotationType.setSelection(getEntity().getAnnotationType());
-               text.setText(entity.getText());
+               if (combo_annotationType != null){
+                       combo_annotationType.setSelection(getEntity().getAnnotationType());
+                       text.setText(entity.getText());
+               }
        }
 
        @Override