Skip to content

Commit

Permalink
Merge pull request #8385 from hzi-braunschweig/bugfix-8111-symptoms-p…
Browse files Browse the repository at this point in the history
…age-cannot-be-saved

#8111 - Preserv symptom date if it was set
  • Loading branch information
MateStrysewske committed Mar 16, 2022
2 parents 7ed6c0a + 3ec3002 commit ca8eae1
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -32,6 +32,7 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -1028,7 +1029,10 @@ private void addListenerForOnsetFields(ComboBox onsetSymptom, DateField onsetDat
onsetSymptom.removeItem(sourceField.getCaption());
boolean isOnsetDateFieldEnabled = isAnySymptomSetToYes(getFieldGroup(), allPropertyIds, Arrays.asList(SymptomState.YES));
onsetDateField.setEnabled(isOnsetDateFieldEnabled);
if (!isOnsetDateFieldEnabled) {
Date onsetDate = getValue().getOnsetDate();
if (onsetDate != null) {
onsetDateField.setValue(onsetDate);
} else if (!isOnsetDateFieldEnabled) {
onsetDateField.setValue(null);
}
}
Expand Down

0 comments on commit ca8eae1

Please sign in to comment.