ButtonControl
A control rendering a button whose only purpose is to run its actions.
It is a "stateless" control (it uses the Unit type), holds no value and is not bound to a database column. It is a UI element for triggering business logic, such as API calls, opening dialogs or modifying other controls of the form.
Parameters
Text shown on the button.
Visual style of the button (FILLED by default).
Visibility dependencies on other controls.
Actions to run on click. Must contain at least one action.
Constructors
Properties
Validator responsible for validating this control. Every control type provides its own implementation (e.g. StringValidator). Empty implementation by default
Functions
Whether this control can hold value, i.e. whether it is a value of type T (and for a choice from fixed options - one of them). Checked for initial values and in updateControl. Controls without a value of their own accept nothing: a section, a button, and a repeatable list, which manages its rows itself. Containers check the shape of their initial data in setInitValue.
Children of this control in the current form state, each with a context in which this control is the parent: a section has one set, a repeatable - one per row. The engine walks down the tree through them when initializing, validating and collecting data.
Converts the control's internal state (ControlState) into a result to save (ControlResultData). Can be overridden for custom conversions (e.g. in RepeatableControl).
Makes a deep copy of the initial value for the current value. Matters for mutable types (e.g. List), so that changes to value do not affect initValue.
Renders the control's own UI. Every concrete control type (e.g. StringControl) implements it.
Renders this control's validation errors.
Runs the actions defined for this control, usually after a value change.
Returns the control's result (current and initial value) for further processing. If the control is invisible, its currentValue is set to null.
Sets the references to the form components. This is the second stage of a control's initialization, called by FormHandler. Gives access to the global state, the schema and the error manager. Also lets particular controls run additional initialization steps they need
Registers the children in the global map Holds references to the controls defined inside a control that has its own
Why the control does not accept value, or null when it does.
Renders the control in the user interface. This is the entry point for FormView. Handles visibility.
Sets the control's initial value and creates its state (ControlState).
Runs this control's validation with its validator.