RepeatableValidator
class RepeatableValidator(val validationOptions: RepeatableValidation? = null) : ControlValidator<List<RepeatableRow>>
Validator of RepeatableControl.
Validates controls that let the user add many rows of data (e.g. a list of authors, tags, categories).
Features:
Checking that values in given fields are unique
Validating the minimum and maximum number of items
It does not validate the rows' fields - the engine walks down to them itself through childContexts, as to the children of a section.
Functions
Link copied to clipboard
Checks whether the control is required, based on its configuration and dependencies.
Link copied to clipboard
Link copied to clipboard
private fun isDependencyMet(dependency: ControlDependency<*>, controlContext: ControlContext): Boolean
Link copied to clipboard
Checks whether the value is empty or not filled in.
Link copied to clipboard
internal open fun setupFormReferences(formState: FormState, formSchema: FormSchema, errorManager: ErrorManager)
Sets the form component references for the validator.
Link copied to clipboard
Main validation method of a control.
Link copied to clipboard
private fun validateListRules(rows: List<RepeatableRow>, options: RepeatableValidation): List<String>
Link copied to clipboard
Validates that values are unique across the rows of a repeatable control. Works on the global form state.
Link copied to clipboard
private fun validateUniqueness(rows: List<RepeatableRow>, options: RepeatableValidation, controlContext: ControlContext): String?