NativeFormAdapter

class NativeFormAdapter(form: Form)

Experimental adapter over the existing Compose-backed form engine. Collect and mutate on the main thread. No Compose view or recomposer is required. Each collector owns and disposes its snapshot observer when collection is cancelled.

Constructors

Link copied to clipboard
constructor(form: Form)

Properties

Link copied to clipboard

Functions

Link copied to clipboard
Link copied to clipboard
fun customField(key: String): Field<*>?

The live Kotlin field behind a CUSTOM snapshot, for the application's own renderer to cast to its class and read or update typed state. Null when the key is not a visible custom field. The renderer must honor the snapshot's enabled state itself.

Link copied to clipboard
fun focusNext(key: String)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun onFocusChanged(key: String, focused: Boolean)
Link copied to clipboard

Runs the Kotlin callback of a visible, enabled action field.

Link copied to clipboard
fun selectOption(key: String, optionId: String?): Boolean

Null requests user clearing. The model enforces clearing and option membership.

Link copied to clipboard
Link copied to clipboard
fun setDate(key: String, year: Int, month: Int, day: Int, hour: Int, minute: Int): Boolean

Applies calendar components to a date or date-time field. Time components are ignored for date-only fields. Impossible components such as February 30 are rejected.

Link copied to clipboard
fun setPhoneDialCode(key: String, dialCode: String): String?

Sets the typed dial code of a phone row without a country picker and returns the dial code the row now holds, which the input shows instead of dialCode: a rejected digit leaves the value, and so the snapshots, unchanged. Null when the row has a country picker or is not editable.

Link copied to clipboard
fun setSelected(key: String, selected: Boolean): Boolean

The option key identifies the control; its typed value stays in Kotlin. In a single selection group, selecting moves the selection and deselecting follows the group's deselection policy.

Link copied to clipboard
fun setText(key: String, value: String): Boolean
Link copied to clipboard
fun setToggle(key: String, value: Boolean): Boolean
Link copied to clipboard

Cancels pending navigation when this renderer is detached. Form values remain shared.

Link copied to clipboard

fun validate(includeHidden: Boolean, warningAsError: Boolean): Boolean

The same submission and navigation policies as Form.validate.