FormBinding
class FormBinding[Owner, Schema, Domain, Msg]Rendering and event wiring for one form instance. Feedback updates are applied in the handler, against the current model, rather than against the form sampled during rendering.
Parameters
refThe form's DOM reference. It supplies the form's
idand scopes the ids of bound controls.feedbackThe policy that decides when field errors become visible.
Defined by scalive.FormBinding. View source (scalive/api/src/scalive/forms/FormBinding.scala:13-200)
Methods7
blurred
def blurred[Group, Input, Value](field: BoundFormField[Owner, Schema, Group, Input, Value]): MsgThe update message that marks a field as blurred.
This form takes an existing schema- and key-owned repeated field. A blur for a row that has since been removed is ignored.
Defined by scalive.FormBinding.blurred. View source (scalive/api/src/scalive/forms/FormBinding.scala:158-159)
def blurred[Group, Row, Input, Value](rows: RepeatedRows[Owner, Group, Row], key: FormRowKey[Group], field: FormField[Group, Input, Value]): MsgThe update message that marks a field as blurred.
This form takes the row group, a stable row key, and a row field. A blur for a row that has since been removed is ignored.
Defined by scalive.FormBinding.blurred. View source (scalive/api/src/scalive/forms/FormBinding.scala:166-178)
def blurred[Input, Value](field: FormField[Owner, Input, Value]): MsgThe update message that marks a field as blurred.
A composite widget sends it when focus leaves the whole widget; under AfterBlur it makes the field's errors visible. This form takes a field declared on the form root.
Defined by scalive.FormBinding.blurred. View source (scalive/api/src/scalive/forms/FormBinding.scala:150-151)
field
def field[Group, Input, Value](field: BoundFormField[Owner, Schema, Group, Input, Value]): FormControl[Owner, Input, Value, Nothing]Binds one field to a FormControl whose ids are scoped to this form instance.
This form takes an existing schema- and key-owned repeated field. Render it only while its row exists; use optionalField for a control outside keyed row rendering.
Defined by scalive.FormBinding.field. View source (scalive/api/src/scalive/forms/FormBinding.scala:102-104)
def field[Group, Row, Input, Value](rows: RepeatedRows[Owner, Group, Row], key: FormRowKey[Group], field: FormField[Group, Input, Value]): FormControl[Owner, Input, Value, Nothing]Binds one field to a FormControl whose ids are scoped to this form instance.
This form takes a stable row key inside a signal's keyed rendering callback. The row must exist whenever this control is evaluated; use optionalField outside keyed rendering.
Defined by scalive.FormBinding.field. View source (scalive/api/src/scalive/forms/FormBinding.scala:111-116)
def field[Input, Value](field: FormField[Owner, Input, Value]): FormControl[Owner, Input, Value, Nothing]Binds one field to a FormControl whose ids are scoped to this form instance.
This form takes a field declared on the form root.
Defined by scalive.FormBinding.field. View source (scalive/api/src/scalive/forms/FormBinding.scala:93-95)
modifiers
def modifiers: Vector[Mod[Msg]]Form attributes and the internal blur trigger. Include exactly once on the owning form. Under AfterBlur these include a nameless hidden child, not just attributes.
Defined by scalive.FormBinding.modifiers. View source (scalive/api/src/scalive/forms/FormBinding.scala:57-68)
optionalField
def optionalField[Group, Input, Value](field: BoundFormField[Owner, Schema, Group, Input, Value])(render: FormControl[Owner, Input, Value, Nothing] => HtmlElement[Msg]): Mod[Msg]Renders one repeated-row field with render, or nothing while its row is absent.
This form takes a captured BoundFormField. It installs an optional signal scope so a later row removal never evaluates a stale control.
Defined by scalive.FormBinding.optionalField. View source (scalive/api/src/scalive/forms/FormBinding.scala:123-128)
def optionalField[Group, Row, Input, Value](rows: RepeatedRows[Owner, Group, Row], key: FormRowKey[Group], field: FormField[Group, Input, Value])(render: FormControl[Owner, Input, Value, Nothing] => HtmlElement[Msg]): Mod[Msg]Renders one repeated-row field with render, or nothing while its row is absent.
This form takes the row group, a stable row key, and a row field, for use outside a keyed row loop.
Defined by scalive.FormBinding.optionalField. View source (scalive/api/src/scalive/forms/FormBinding.scala:135-142)
presence
def presence[Group, Row](rows: RepeatedRows[Owner, Group, Row], key: FormRowKey[Group], mods: Mod.Input[Msg]*): HtmlElement[Msg]Renders the hidden control that keeps the row with key in rows, and its order, in the next
submission.
Render it in every row, inside a signal's keyed rendering callback, even when all the row's visible fields are empty or unchecked. The row must exist whenever the control is evaluated. Its id is scoped to this form instance.
The control owns its id, name, value, and type attributes. Setting one in mods, in
any letter case, throws IllegalArgumentException.
Defined by scalive.FormBinding.presence. View source (scalive/api/src/scalive/forms/FormBinding.scala:190-195)
render
def render(mods: Mod.Input[Msg]*): HtmlElement[Msg]Renders a form with its bindings and internal trigger. Do not override the generated id or change, recovery, and submit bindings. Use modifiers for an existing form renderer.
Defined by scalive.FormBinding.render. View source (scalive/api/src/scalive/forms/FormBinding.scala:73-87)
rows
def rows[Group, Row](rows: RepeatedRows[Owner, Group, Row]): Signal[Vector[FormRowView[Owner, Schema, Group, Row]]]Defined by scalive.FormBinding.rows. View source (scalive/api/src/scalive/forms/FormBinding.scala:198-199)
Values2
feedback
val feedback: FormFeedbackThe policy that decides when field errors become visible.
Defined by scalive.FormBinding.feedback. View source (scalive/api/src/scalive/forms/FormBinding.scala:16-16)
ref
val ref: DomRefThe form's DOM reference. It supplies the form's id and scopes the ids of bound controls.
Defined by scalive.FormBinding.ref. View source (scalive/api/src/scalive/forms/FormBinding.scala:15-15)