@Override
public void createControls(ICdmFormElement element, int style) {
- comboStateVocabulary = formFactory.createVocabularyComboElement(TermType.State, "State vocabularies", null, element, style);
+ comboStateVocabulary = formFactory.createVocabularyComboElement(TermType.State, "State vocabulary", null, element, style);
}
@Override
this.entity = entity;
if(entity.getId()!=0){
comboStateVocabulary.setSelection(entity);
+ comboStateVocabulary.removeEmptyElement();
}
}
public void handleEvent(Object eventSource) {
if(eventSource==comboStateVocabulary && comboStateVocabulary.getSelection()!=null){
if(getParentElement() instanceof StateVocabularyCollectionSection){
- Feature feature = ((StateVocabularyCollectionSection) getParentElement()).getEntity();
+ StateVocabularyCollectionSection parentElement = (StateVocabularyCollectionSection) getParentElement();
+ Feature feature = parentElement.getEntity();
feature.removeSupportedCategoricalEnumeration(entity);
TermVocabulary<State> vocabulary = comboStateVocabulary.getSelection();
feature.addSupportedCategoricalEnumeration(vocabulary);
entity = vocabulary;
+ //update the parent section to re-set the listeners to the persisted measurement unit
+ parentElement.removeElementAndUpdate(null);
}
}
}