Skip to content

Commit

Permalink
[xdata] Automatically fill required fields with a default value
Browse files Browse the repository at this point in the history
  • Loading branch information
Flowdalic committed Apr 1, 2021
1 parent 68edc8b commit 090858f
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,13 @@ public FillableForm(DataForm dataForm) {
if (formField.isRequired()) {
String fieldName = formField.getFieldName();
requiredFields.add(fieldName);
missingRequiredFields.add(fieldName);

if (formField.hasValueSet()) {
// This is a form field with a default value.
write(formField);
} else {
missingRequiredFields.add(fieldName);
}
}
}
this.requiredFields = Collections.unmodifiableSet(requiredFields);
Expand Down

0 comments on commit 090858f

Please sign in to comment.