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
rawordered, duplicate-preserving textual form fields
valuethe codec result for
raw, including ordered validation errorstargetthe changed field reported by client
_targetmetadata, when present; protocol decoding uses permissive FormPath semantics and can be lossy for array bracketssubmitterthe successful submit control reported by the client, when available
recoverywhether client metadata identifies this as a form recovery event
submittedwhether this was decoded through a typed
phx-submitbinding; this controls used-field visibility in state and is distinct from recoverymetadatastringified semantic client event metadata
Type parameters
Athe successfully decoded form value
Defined by scalive.FormEvent. View source (scalive/api/src/scalive/forms/FormEvent.scala:28-49)
Methods5
data
def data: FormDataAlias for raw.
Defined by scalive.FormEvent.data. View source (scalive/api/src/scalive/forms/FormEvent.scala:40-40)
errors
def errors: FormErrorsThe 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: BooleanWhether 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]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: FormDataDefined by scalive.FormEvent.raw. View source (scalive/api/src/scalive/forms/FormEvent.scala:29-29)
recovery
val recovery: BooleanDefined by scalive.FormEvent.recovery. View source (scalive/api/src/scalive/forms/FormEvent.scala:33-33)
submitted
val submitted: BooleanDefined 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)