Revision b0d7867b
Added by Patrick Plitzner almost 9 years ago
- removed empty element from combo dropdown #4448
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/MeasurementUnitCollectionElement.java | ||
---|---|---|
56 | 56 |
this.entity = entity; |
57 | 57 |
if(entity.getId()!=0){ |
58 | 58 |
comboMeasurementUnit.setSelection(entity); |
59 |
comboMeasurementUnit.removeEmptyElement(); |
|
59 | 60 |
} |
60 | 61 |
} |
61 | 62 |
|
... | ... | |
63 | 64 |
public void handleEvent(Object eventSource) { |
64 | 65 |
if(eventSource==comboMeasurementUnit && comboMeasurementUnit.getSelection()!=null){ |
65 | 66 |
if(getParentElement() instanceof MeasurementUnitCollectionSection){ |
66 |
Feature feature = ((MeasurementUnitCollectionSection) getParentElement()).getEntity(); |
|
67 |
MeasurementUnitCollectionSection parentElement = (MeasurementUnitCollectionSection) getParentElement(); |
|
68 |
Feature feature = parentElement.getEntity(); |
|
67 | 69 |
feature.removeRecommendedMeasurementUnit(entity); |
68 | 70 |
MeasurementUnit measurementUnit = comboMeasurementUnit.getSelection(); |
69 | 71 |
feature.addRecommendedMeasurementUnit(measurementUnit); |
70 | 72 |
entity = measurementUnit; |
73 |
//update the parent section to re-set the listeners to the persisted measurement unit |
|
74 |
parentElement.removeElementAndUpdate(null); |
|
71 | 75 |
} |
72 | 76 |
} |
73 | 77 |
} |
Also available in: Unified diff