Form
class Form<K : Any>(panel: FormPanel<K>? = null, serializer: <Error class: unknown class><K>? = null, customSerializers: Map<KClass<*>, <Error class: unknown class><out <Error class: unknown class>>>? = null)
The form definition class. Can be used directly or indirectly inside a FormPanel.
Parameters
K
model class type
panel
optional instance of FormPanel
serializer
a serializer for model type
custom Serializers
a map of custom serializers for model type
Constructors
Functions
Link copied to clipboard
fun <C : FormControl> add(key: String, control: C, required: Boolean = false, requiredMessage: String? = null, validatorMessage: (C) -> String?? = null, validator: (C) -> Boolean?? = null)
Adds a form control to the form with a dynamic keys.
fun <C : DateFormControl> add(key: KProperty1<K, <Error class: unknown class>?>, control: C, required: Boolean = false, requiredMessage: String? = null, validatorMessage: (C) -> String?? = null, validator: (C) -> Boolean?? = null)
Adds a date control to the form.
fun <C : BoolFormControl> add(key: KProperty1<K, Boolean?>, control: C, required: Boolean = false, requiredMessage: String? = null, validatorMessage: (C) -> String?? = null, validator: (C) -> Boolean?? = null)
Adds a boolean control to the form.
fun <C : TriStateFormControl> add(key: KProperty1<K, Boolean?>, control: C, required: Boolean = false, requiredMessage: String? = null, validatorMessage: (C) -> String?? = null, validator: (C) -> Boolean?? = null)
Adds a nullable boolean control to the form.
fun <C : NumberFormControl> add(key: KProperty1<K, Number?>, control: C, required: Boolean = false, requiredMessage: String? = null, validatorMessage: (C) -> String?? = null, validator: (C) -> Boolean?? = null)
Adds a number control to the form.
fun <C : StringFormControl> add(key: KProperty1<K, String?>, control: C, required: Boolean = false, requiredMessage: String? = null, validatorMessage: (C) -> String?? = null, validator: (C) -> Boolean?? = null)
Adds a string control to the form.
fun <C : KFilesFormControl> add(key: KProperty1<K, List<<Error class: unknown class>>?>, control: C, required: Boolean = false, requiredMessage: String? = null, validatorMessage: (C) -> String?? = null, validator: (C) -> Boolean?? = null)
Adds a files control to the form.
Link copied to clipboard
Link copied to clipboard
Clear validation information from all fields.
Link copied to clipboard
Returns a control with a given dynamic key.
Returns a control with a given key.
Link copied to clipboard
Returns current data model as JSON.
Link copied to clipboard
Link copied to clipboard
Returns the first control added to the form.
Link copied to clipboard