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 / vocabulary / StateVocabularyCollectionElement.java
index 8c9b65e9d3a5f6e46f1f545035951821ffad8edd..f7a18d8441bc01b5de30218a4fba96a4d7073269 100644 (file)
@@ -49,12 +49,15 @@ public class StateVocabularyCollectionElement extends AbstractEntityCollectionEl
     @Override
     public void createControls(ICdmFormElement element, int style) {
         comboStateVocabulary = formFactory.createVocabularyComboElement(TermType.State, "State vocabulary", null, element, style);
+        if (entity != null){
+               setEntity(entity);
+        }
     }
 
     @Override
     public void setEntity(TermVocabulary<State> entity) {
         this.entity = entity;
-        if(entity.getId()!=0){
+        if(entity.getId()!=0 && comboStateVocabulary != null){
             comboStateVocabulary.setSelection(entity);
             comboStateVocabulary.removeEmptyElement();
         }