Skip to content
scalive
Menu
ConnectingLiveReconnectingOffline
GitHub
c

Form

class Form[Owner, Schema, Domain]

Immutable current semantic values, validation result, and interaction state.

Obtain instances from initial or event. Raw values are retained in values so invalid user input can be rendered without lossy round trips.

Defined by scalive.Form. View source (scalive/api/src/scalive/forms/Form.scala:12-336)

Methods22

added

def added[Group, Row](rows: RepeatedRows[Owner, Group, Row], key: FormRowKey[Group])(assignments: FormInitial[Group]*): Form[Owner, Schema, Domain]

Appends a new row with a group-scoped stable key and owner-checked assignments.

Defined by scalive.Form.added. View source (scalive/api/src/scalive/forms/Form.scala:206-232)

appended

def appended[Value](field: FormField[Owner, Vector[String], Value], value: String): Form[Owner, Schema, Domain]

Appends one raw value to a multi-value static field.

Defined by scalive.Form.appended. View source (scalive/api/src/scalive/forms/Form.scala:154-158)

disableRecovery

def disableRecovery: Mod.Attr[Nothing]

Disables Phoenix automatic form recovery for the rendered form.

Defined by scalive.Form.disableRecovery. View source (scalive/api/src/scalive/forms/Form.scala:72-72)

errors

def errors: FormErrors[Owner]

All validation errors, including errors currently hidden by interaction state.

Defined by scalive.Form.errors. View source (scalive/api/src/scalive/forms/Form.scala:25-25)

field

def field[Group, Input, Value](definition: BoundFormField[Owner, Schema, Group, Input, Value]): FormFieldView[Owner, Input, Value]

Returns the current view of a schema-bound repeated-row field.

The bound row must still exist in this form's current values.

Defined by scalive.Form.field. View source (scalive/api/src/scalive/forms/Form.scala:89-94)

def field[Input, Value](definition: FormField[Owner, Input, Value]): FormFieldView[Owner, Input, Value]

Returns the renderable view of a static field declared by this form's definition.

Defined by scalive.Form.field. View source (scalive/api/src/scalive/forms/Form.scala:79-83)

fieldOption

def fieldOption[Group, Input, Value](definition: BoundFormField[Owner, Schema, Group, Input, Value]): Option[FormFieldView[Owner, Input, Value]]

Returns the current view of a schema-bound field when its row still exists.

Defined by scalive.Form.fieldOption. View source (scalive/api/src/scalive/forms/Form.scala:97-114)

isValid

def isValid: Boolean

Whether all structural, field, row, and product validation succeeded.

Defined by scalive.Form.isValid. View source (scalive/api/src/scalive/forms/Form.scala:19-19)

movedAfter

def movedAfter[Group, Row](rows: RepeatedRows[Owner, Group, Row], key: FormRowKey[Group], target: FormRowKey[Group]): Form[Owner, Schema, Domain]

Moves a keyed row immediately after another keyed row without changing either identity.

Defined by scalive.Form.movedAfter. View source (scalive/api/src/scalive/forms/Form.scala:258-263)

movedBefore

def movedBefore[Group, Row](rows: RepeatedRows[Owner, Group, Row], key: FormRowKey[Group], target: FormRowKey[Group]): Form[Owner, Schema, Domain]

Moves a keyed row immediately before another keyed row without changing either identity.

Defined by scalive.Form.movedBefore. View source (scalive/api/src/scalive/forms/Form.scala:250-255)

onChange

def onChange[Msg](changed: FormEvent[Owner, Schema, Domain] => Msg, recovered: FormEvent[Owner, Schema, Domain] => Msg): Mod.Attr[Msg]

Handles LiveView phx-change and recovery with separate schema-safe callbacks.

Defined by scalive.Form.onChange. View source (scalive/api/src/scalive/forms/Form.scala:36-43)

def onChange[Msg](f: FormEvent[Owner, Schema, Domain] => Msg): Mod.Attr[Msg]

Handles LiveView phx-change and recovery while preserving this form's schema type.

Defined by scalive.Form.onChange. View source (scalive/api/src/scalive/forms/Form.scala:32-33)

onRecover

def onRecover[Msg](f: FormEvent[Owner, Schema, Domain] => Msg): Mod.Attr[Msg]

Handles a typed recovery event.

Defined by scalive.Form.onRecover. View source (scalive/api/src/scalive/forms/Form.scala:68-69)

onSubmit

def onSubmit[Action <: reflect.Enum, Msg](submitter: FormSubmitter[Owner, Schema, Action])(f: (FormEvent[Owner, Schema, Domain], Either[FormSubmitter.DecodeError, Action]) => Msg): Mod.Attr[Msg]

Handles a typed submission and decodes one definition-owned submit action.

Defined by scalive.Form.onSubmit. View source (scalive/api/src/scalive/forms/Form.scala:50-65)

def onSubmit[Msg](f: FormEvent[Owner, Schema, Domain] => Msg): Mod.Attr[Msg]

Handles a typed submission event.

Defined by scalive.Form.onSubmit. View source (scalive/api/src/scalive/forms/Form.scala:46-47)

pristine

def pristine: Form[Owner, Schema, Domain]

Returns this value state with interaction history reset and its feedback policy retained.

Defined by scalive.Form.pristine. View source (scalive/api/src/scalive/forms/Form.scala:277-280)

removed

def removed[Group, Row](rows: RepeatedRows[Owner, Group, Row], key: FormRowKey[Group]): Form[Owner, Schema, Domain]

Removes the row with key and clears interaction state below its address.

Defined by scalive.Form.removed. View source (scalive/api/src/scalive/forms/Form.scala:235-247)

removedAt

def removedAt[Value](field: FormField[Owner, Vector[String], Value], index: Int): Form[Owner, Schema, Domain]

Removes a raw multi-value entry by position, failing when the index is out of bounds.

Defined by scalive.Form.removedAt. View source (scalive/api/src/scalive/forms/Form.scala:161-170)

rows

def rows[Group, Row](definition: RepeatedRows[Owner, Group, Row]): Vector[FormRowView[Owner, Schema, Group, Row]]

Returns repeated rows in submitted or programmatically mutated order.

Each view carries its stable key; vector position is not row identity.

Defined by scalive.Form.rows. View source (scalive/api/src/scalive/forms/Form.scala:120-129)

triggerHttpSubmitWhen

def triggerHttpSubmitWhen(condition: Boolean): Mod.Attr[Nothing]

Requests a conventional HTTP submission when condition becomes true.

Defined by scalive.Form.triggerHttpSubmitWhen. View source (scalive/api/src/scalive/forms/Form.scala:75-76)

updated

def updated[Group, Input, Value](field: BoundFormField[Owner, Schema, Group, Input, Value], input: Input): Form[Owner, Schema, Domain]

Updates the row identified by a schema-bound field handle from typed editable input.

Defined by scalive.Form.updated. View source (scalive/api/src/scalive/forms/Form.scala:173-177)

def updated[Input, Value](field: FormField[Owner, Input, Value], input: Input): Form[Owner, Schema, Domain]

Replaces a static field from typed editable input and immediately revalidates the form.

Defined by scalive.Form.updated. View source (scalive/api/src/scalive/forms/Form.scala:132-136)

updatedRaw

def updatedRaw[Group, Input, Value](field: BoundFormField[Owner, Schema, Group, Input, Value], raw: Vector[String]): Form[Owner, Schema, Domain]

Replaces a bound row field's raw values.

The handle must come from this exact definition and its keyed row must still exist.

Defined by scalive.Form.updatedRaw. View source (scalive/api/src/scalive/forms/Form.scala:183-203)

def updatedRaw[Input, Value](field: FormField[Owner, Input, Value], raw: Vector[String]): Form[Owner, Schema, Domain]

Replaces a static field with explicit raw values, preserving invalid control input.

Defined by scalive.Form.updatedRaw. View source (scalive/api/src/scalive/forms/Form.scala:139-151)

validSnapshot

def validSnapshot: Option[ValidFormSnapshot[Owner, Schema, Domain]]

Captures definition-owned values and domain value only when validation succeeds.

Defined by scalive.Form.validSnapshot. View source (scalive/api/src/scalive/forms/Form.scala:290-291)

valueOption

def valueOption: Option[Domain]

The decoded domain value, available only when isValid.

Defined by scalive.Form.valueOption. View source (scalive/api/src/scalive/forms/Form.scala:22-22)

withAllErrorsVisible

def withAllErrorsVisible: Form[Owner, Schema, Domain]

Returns this value state with every existing validation error visible, as on submission.

Defined by scalive.Form.withAllErrorsVisible. View source (scalive/api/src/scalive/forms/Form.scala:266-274)

Values3

interaction

val interaction: FormInteraction[Owner]

Defined by scalive.Form.interaction. View source (scalive/api/src/scalive/forms/Form.scala:16-16)

result

val result: util.Either[FormErrors[Owner], Domain]

Defined by scalive.Form.result. View source (scalive/api/src/scalive/forms/Form.scala:15-15)

values

val values: FormValues[Owner, Schema]

Defined by scalive.Form.values. View source (scalive/api/src/scalive/forms/Form.scala:14-14)