Skip to content

Commit 5d70cf6

Browse files
authored
Merge pull request #13510 from SORMAS-Foundation/bugfix-13505_error_national_clinician_case_form_save
#13505 - Fixed binding error for health conditions form
2 parents 54c7524 + 2c02a05 commit 5d70cf6

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

sormas-ui/src/main/java/de/symeda/sormas/ui/clinicalcourse/HealthConditionsForm.java

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,10 @@
3535
import static de.symeda.sormas.ui.utils.LayoutUtil.locs;
3636

3737
import java.util.Arrays;
38+
import java.util.HashSet;
3839
import java.util.List;
3940
import java.util.Set;
41+
import java.util.stream.Collectors;
4042

4143
import com.vaadin.ui.CustomLayout;
4244
import com.vaadin.ui.Label;
@@ -255,10 +257,18 @@ protected <F extends Field> F addFieldToLayout(CustomLayout layout, String prope
255257
}
256258

257259
public void setInaccessible() {
258-
fieldsList.stream().forEach(field -> {
259-
getContent().getComponent(field).setVisible(false);
260+
final HashSet<String> disableFields = new HashSet<>(fieldsList);
261+
disableFields.add(OTHER_CONDITIONS);
262+
final List<Field<?>> fields = disableFields.stream()
263+
.map(e -> getContent().getComponent(e))
264+
.filter(f -> f instanceof Field<?>)
265+
.map(f -> (Field<?>) f)
266+
.collect(Collectors.toList());
267+
fields.forEach(field -> {
268+
field.setVisible(false);
269+
getFieldGroup().unbind(field);
260270
});
261-
getContent().getComponent(OTHER_CONDITIONS).setVisible(false);
271+
262272
Label confidentialLabel = new Label(I18nProperties.getCaption(Captions.inaccessibleValue));
263273
confidentialLabel.addStyleName(CssStyles.INACCESSIBLE_LABEL);
264274
getContent().addComponent(confidentialLabel, CONFIDENTIAL_LABEL_LOC);

0 commit comments

Comments
 (0)