Skip to content
This repository was archived by the owner on May 5, 2021. It is now read-only.

Commit 49057de

Browse files
SORMAS-Foundation#3110 - Incorrect behavior on Person forms related to Facility fields
1 parent 4eaa8d9 commit 49057de

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

sormas-ui/src/main/java/de/symeda/sormas/ui/location/LocationEditForm.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,16 @@ protected void addFields() {
214214
facilityTypeGroup.addValueChangeListener(e -> {
215215
FieldHelper.removeItems(facility);
216216
FieldHelper.updateEnumData(facilityType, FacilityType.getTypes((FacilityTypeGroup) facilityTypeGroup.getValue()));
217+
if (facilityTypeGroup.getValue() != null) {
218+
facilityType.setRequired(true);
219+
} else {
220+
facilityType.setRequired(false);
221+
}
217222
});
218223
facilityType.addValueChangeListener(e -> {
219224
FieldHelper.removeItems(facility);
220225
if (facilityType.getValue() != null && facilityTypeGroup.getValue() == null) {
221-
FacilityType temp = (FacilityType) facilityType.getValue();
222-
facilityTypeGroup.setValue(temp.getFacilityTypeGroup());
226+
facilityTypeGroup.setValue(((FacilityType) facilityType.getValue()).getFacilityTypeGroup());
223227
}
224228
if (facilityType.getValue() != null && district.getValue() != null) {
225229
if (community.getValue() != null) {

0 commit comments

Comments
 (0)