open class FormPanel<K> : SimplePanel
Bootstrap form component.
FormPanel(type: FORMTYPE? = null, classes: Set<String> = setOf(), modelFactory: (Map<String, Any?>) -> K) |
var validator: (Form<K>) -> Boolean?
Validation function. |
|
var validatorMessage: (Form<K>) -> String?
Function returning validation message. |
open fun <C : FormControl> add(key: String, control: C, required: Boolean = false, validatorMessage: (C) -> String? = null, validator: (C) -> Boolean? = null): FormPanel<K>
Adds a control to the form panel. |
|
open fun clearData(): Unit
Sets the values of all controls to null. |
|
operator fun get(key: String): Any?
Returns a value of the control of given key. |
|
open fun getControl(key: String): FormControl?
Returns a control of given key. |
|
open fun getData(): K
Returns current data model. |
|
open fun getDataJson(): Json
Returns current data model as JSON. |
|
open fun getSnClass(): List<StringBoolPair>
Returns list of CSS class names for current widget in the form of a List. |
|
open fun remove(key: String): FormPanel<K>
Removes a control from the form panel. |
|
open fun removeAll(): FormPanel<K>
Removes all children from the current container. |
|
open fun render(): VNode
Renders current component as a Snabbdom vnode. |
|
open fun setData(model: K): Unit
Sets the values of all the controls from the model. |
|
open fun validate(): Boolean
Invokes validator function and validates the form. |
open fun add(child: Component): SimplePanel
Adds given component to the current container. |
|
open fun addAll(children: List<Component>): SimplePanel
Adds a list of components to the current container. |
|
fun addInternal(child: Component): SimplePanel
Protected and final method to add given component to the current container. |
|
open fun childrenVNodes(): Array<VNode>
Returns the array of the children Snabbdom vnodes. |
|
open fun getChildren(): List<Component>
Returns a list of children of the current container. |
|
open fun remove(child: Component): SimplePanel
Removes given component from the current container. |
fun <K> Container.formPanel(type: FORMTYPE? = null, classes: Set<String> = setOf(), modelFactory: (Map<String, Any?>) -> K): FormPanel<K>
DSL builder extension function |