mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-22 14:22:05 +01:00
[xdata] Automatically fill required fields with a default value
This commit is contained in:
parent
68edc8b9f5
commit
090858f467
1 changed files with 7 additions and 1 deletions
|
@ -59,9 +59,15 @@ public class FillableForm extends FilledForm {
|
||||||
if (formField.isRequired()) {
|
if (formField.isRequired()) {
|
||||||
String fieldName = formField.getFieldName();
|
String fieldName = formField.getFieldName();
|
||||||
requiredFields.add(fieldName);
|
requiredFields.add(fieldName);
|
||||||
|
|
||||||
|
if (formField.hasValueSet()) {
|
||||||
|
// This is a form field with a default value.
|
||||||
|
write(formField);
|
||||||
|
} else {
|
||||||
missingRequiredFields.add(fieldName);
|
missingRequiredFields.add(fieldName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
this.requiredFields = Collections.unmodifiableSet(requiredFields);
|
this.requiredFields = Collections.unmodifiableSet(requiredFields);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue