FieldControl
class FieldControl<V>(val name: FieldName, val policy: FieldPolicy, val rule: FormRule<V>, val defaultValue: V, val getValue: () -> V, val setValue: (V) -> Unit, val getErrors: () -> FieldErrors, val setErrors: (FieldErrors) -> Unit, val shouldTrigger: (FieldValidateOn) -> Boolean, val isEnabled: () -> Boolean)
Represents a field control in a form.
Parameters
V
The type of the field value.
Constructors
Link copied to clipboard
constructor(name: FieldName, policy: FieldPolicy, rule: FormRule<V>, defaultValue: V, getValue: () -> V, setValue: (V) -> Unit, getErrors: () -> FieldErrors, setErrors: (FieldErrors) -> Unit, shouldTrigger: (FieldValidateOn) -> Boolean, isEnabled: () -> Boolean)
Properties
Link copied to clipboard
The default value of the field.
Link copied to clipboard
The function to get the current field errors.
Link copied to clipboard
The policy of the field.
Link copied to clipboard
The function to set the new field errors. If the new errors are empty, the field is considered valid.
Link copied to clipboard
The function to determine if the field should trigger validation on the given event.