Skip to content
scalive
Menu
ConnectingLiveReconnectingOffline
c

FormEvent

class FormEvent[+A](raw: FormData, value: Either[FormErrors, A], target: Option[FormPath] = ..., submitter: Option[FormSubmitter] = ..., recovery: Boolean = ..., submitted: Boolean = ..., metadata: Map[String, String] = ...)

A typed LiveView form event and its semantic browser metadata.

Application code usually receives this value from a typed form binding. The public case-class constructor is also available for tests and adapters, but it is low-level: it does not verify that value was decoded from raw or that metadata fields agree with each other.

Parameters

raw

ordered, duplicate-preserving textual form fields

value

the codec result for raw, including ordered validation errors

target

the changed field reported by client _target metadata, when present; protocol decoding uses permissive FormPath semantics and can be lossy for array brackets

submitter

the successful submit control reported by the client, when available

recovery

whether client metadata identifies this as a form recovery event

submitted

whether this was decoded through a typed phx-submit binding; this controls used-field visibility in state and is distinct from recovery

metadata

stringified semantic client event metadata

Type parameters

A

the successfully decoded form value

Defined by scalive.FormEvent. View source (scalive/api/src/scalive/forms/FormEvent.scala:28-49)

Methods5

data

def data: FormData

Alias for raw.

Defined by scalive.FormEvent.data. View source (scalive/api/src/scalive/forms/FormEvent.scala:40-40)

errors

def errors: FormErrors

The decoding errors, or empty when valid.

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

isValid

def isValid: Boolean

Whether decoding and validation succeeded.

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

state

def state: FormState[A]

Builds form state, deriving used paths from raw and submitted.

Defined by scalive.FormEvent.state. View source (scalive/api/src/scalive/forms/FormEvent.scala:37-37)

valueOption

def valueOption: Option[A]

The decoded value when valid.

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

Values7

metadata

val metadata: Map[String, String]

Defined by scalive.FormEvent.metadata. View source (scalive/api/src/scalive/forms/FormEvent.scala:35-35)

raw

val raw: FormData

Defined by scalive.FormEvent.raw. View source (scalive/api/src/scalive/forms/FormEvent.scala:29-29)

recovery

val recovery: Boolean

Defined by scalive.FormEvent.recovery. View source (scalive/api/src/scalive/forms/FormEvent.scala:33-33)

submitted

val submitted: Boolean

Defined by scalive.FormEvent.submitted. View source (scalive/api/src/scalive/forms/FormEvent.scala:34-34)

submitter

val submitter: Option[FormSubmitter]

Defined by scalive.FormEvent.submitter. View source (scalive/api/src/scalive/forms/FormEvent.scala:32-32)

target

val target: Option[FormPath]

Defined by scalive.FormEvent.target. View source (scalive/api/src/scalive/forms/FormEvent.scala:31-31)

value

val value: util.Either[FormErrors, A]

Defined by scalive.FormEvent.value. View source (scalive/api/src/scalive/forms/FormEvent.scala:30-30)