case class Field(form: Form[_], name: String, constraints: Seq[(String, Seq[Any])], format: Option[(String, Seq[Any])], errors: Seq[FormError], value: Option[String]) extends Product with Serializable
A form field.
- name
the field name
- constraints
the constraints associated with the field
- format
the format expected for this field
- errors
the errors associated to this field
- value
the field value, if any
- Source
- Form.scala
- Alphabetic
- By Inheritance
- Field
- Serializable
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
Field(form: Form[_], name: String, constraints: Seq[(String, Seq[Any])], format: Option[(String, Seq[Any])], errors: Seq[FormError], value: Option[String])
- name
the field name
- constraints
the constraints associated with the field
- format
the format expected for this field
- errors
the errors associated to this field
- value
the field value, if any
Value Members
-
def
apply(key: String): Field
Retrieve a field from the same form, using a key relative to this field key.
Retrieve a field from the same form, using a key relative to this field key.
- key
Relative key.
- val constraints: Seq[(String, Seq[Any])]
-
lazy val
error: Option[FormError]
Returns the first error associated with this field, if it exists.
Returns the first error associated with this field, if it exists.
- returns
an error
- val errors: Seq[FormError]
- val format: Option[(String, Seq[Any])]
-
lazy val
hasErrors: Boolean
Check if this field has errors.
-
lazy val
id: String
The field ID - the same as the field name but with '.' replaced by '_'.
-
lazy val
indexes: Seq[Int]
Retrieve available indexes defined for this field (if this field is repeated).
-
lazy val
label: String
The label for the field.
The label for the field. Transforms repeat names from foo[0] etc to foo.0.
- val name: String
- val value: Option[String]