Controller

fun <V> Controller(control: FieldControl<V>, content: @Composable (Field<V>) -> Unit)

Deprecated

Please migrate to the new form implementation. This legacy code will be removed in a future version.

A controller for a form field control.

To minimize the impact of re-composition due to updates in input values, the FieldControl is passed to a Controller, which then connects the actual input component with the Field interface.

Usage:

Form(..) {
..
Controller(control = rememberFirstNameFieldControl()) { field ->
TextField(value = field.value, onValueChange = field.onChange, ...)
}
}

Parameters

V

The type of the field value.

control

The field control to be managed.

content

The content to be displayed.


Deprecated

Please migrate to the new form implementation. This legacy code will be removed in a future version.

A controller for a form submission control.

To minimize the impact of re-composition due to updates in input values, the SubmissionControl is passed to a Controller, which then connects the actual input component with the Submission interface.

Usage:

Form(..) {
..
Controller(control = rememberSubmissionRuleAutoControl()) { submission ->
Button(onClick = submission.onSubmit, enabled = submission.canSubmit, ...)
}
}

Parameters

T

The type of the submission value.

control

The submission control to be managed.

content

The content to be displayed.