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 / description / ScopeElement.java
index 7b07a06e06f152c71cfb3bd06937dff1135fc358..eb3ab4239048938397b4a57b4eb09fd719368adf 100644 (file)
@@ -52,7 +52,7 @@ public class ScopeElement extends AbstractEntityCollectionElement<DefinedTerm> {
        @Override
        public void setEntity(DefinedTerm entity) {
                this.entity = entity;
-               if(entity!=null && entity.getId()!=0){
+               if(entity!=null && entity.getId()!=0 && combo_scope != null){
                    combo_scope.setSelection(entity);
                    combo_scope.removeEmptyElement();
                }
@@ -62,6 +62,9 @@ public class ScopeElement extends AbstractEntityCollectionElement<DefinedTerm> {
        @Override
        public void createControls(ICdmFormElement element, int style) {
                combo_scope = formFactory.createDefinedTermComboElement(TermType.Scope, element, "Scope", null, style);
+               if (entity != null){
+                       setEntity(entity);
+               }
        }
 
        /** {@inheritDoc} */