From c9f98dfdbdc3f56553b58dc226b3f841189d0fc0 Mon Sep 17 00:00:00 2001
From: Robert Jaros Adds a control to the form panel. Adds a string control to the form panel.
+
+addInternal
+
+protected fun <C : FormControl> addInternal(key: KProperty1<K, *>, control: C, required: Boolean = false, validatorMessage: (C) -> String? = null, validator: (C) -> Boolean? = null): FormPanel<K>
+
+
diff --git a/api/pl.treksoft.kvision.form/-form-panel/add.html b/api/pl.treksoft.kvision.form/-form-panel/add.html
index dabf16e2..4d325c15 100644
--- a/api/pl.treksoft.kvision.form/-form-panel/add.html
+++ b/api/pl.treksoft.kvision.form/-form-panel/add.html
@@ -8,14 +8,62 @@
kvision / pl.treksoft.kvision.form / FormPanel / add
add
-
-open fun <C : FormControl> add(key: String, control: C, required: Boolean = false, validatorMessage: (C) -> String? = null, validator: (C) -> Boolean? = null): FormPanel<K>
-open fun <C : StringFormControl> add(key: KProperty1<K, String?>, control: C, required: Boolean = false, validatorMessage: (C) -> String? = null, validator: (C) -> Boolean? = null): FormPanel<K>
+Parameters
key
- key identifier of the controlcontrol
- the string form control
+required
- determines if the control is required
+validatorMessage
- optional function returning validation message
+validator
- optional validation function
Return
+current form panel
open fun <C : BoolFormControl> add(key: KProperty1<K, Boolean?>, control: C, required: Boolean = false, validatorMessage: (C) -> String? = null, validator: (C) -> Boolean? = null): FormPanel<K>
+Adds a boolean control to the form panel.
+
+key
- key identifier of the control
+control
- the boolean form control
+required
- determines if the control is required
+validatorMessage
- optional function returning validation message
+validator
- optional validation function
Return
+current form panel
open fun <C : NumberFormControl> add(key: KProperty1<K, Number?>, control: C, required: Boolean = false, validatorMessage: (C) -> String? = null, validator: (C) -> Boolean? = null): FormPanel<K>
+Adds a number control to the form panel.
+
+key
- key identifier of the control
+control
- the number form control
+required
- determines if the control is required
+validatorMessage
- optional function returning validation message
+validator
- optional validation function
Return
+current form panel
open fun <C : DateFormControl> add(key: KProperty1<K, Date?>, control: C, required: Boolean = false, validatorMessage: (C) -> String? = null, validator: (C) -> Boolean? = null): FormPanel<K>
+Adds a date control to the form panel.
+
+key
- key identifier of the control
+control
- the date form control
required
- determines if the control is required
diff --git a/api/pl.treksoft.kvision.form/-form-panel/get-control.html b/api/pl.treksoft.kvision.form/-form-panel/get-control.html
index e3e8b15c..75960c0a 100644
--- a/api/pl.treksoft.kvision.form/-form-panel/get-control.html
+++ b/api/pl.treksoft.kvision.form/-form-panel/get-control.html
@@ -8,8 +8,8 @@
kvision / pl.treksoft.kvision.form / FormPanel / getControl
open fun getControl(key: String): FormControl?
+
+open fun getControl(key: KProperty1<K, *>): FormControl?
Returns a control of given key.
diff --git a/api/pl.treksoft.kvision.form/-form-panel/get.html b/api/pl.treksoft.kvision.form/-form-panel/get.html
index dd82feb1..6c369e60 100644
--- a/api/pl.treksoft.kvision.form/-form-panel/get.html
+++ b/api/pl.treksoft.kvision.form/-form-panel/get.html
@@ -8,8 +8,8 @@
kvision / pl.treksoft.kvision.form / FormPanel / get
operator fun get(key: String): Any?
+
+operator fun get(key: KProperty1<K, *>): Any?
Returns a value of the control of given key.
diff --git a/api/pl.treksoft.kvision.form/-form-panel/index.html b/api/pl.treksoft.kvision.form/-form-panel/index.html index 99e379a8..2a99b314 100644 --- a/api/pl.treksoft.kvision.form/-form-panel/index.html +++ b/api/pl.treksoft.kvision.form/-form-panel/index.html @@ -53,12 +53,25 @@
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 <C : StringFormControl> add(key: KProperty1<K, String?>, control: C, required: Boolean = false, validatorMessage: (C) -> String? = null, validator: (C) -> Boolean? = null): FormPanel<K>
+Adds a string control to the form panel.
+open fun <C : BoolFormControl> add(key: KProperty1<K, Boolean?>, control: C, required: Boolean = false, validatorMessage: (C) -> String? = null, validator: (C) -> Boolean? = null): FormPanel<K>
+Adds a boolean control to the form panel.
+open fun <C : NumberFormControl> add(key: KProperty1<K, Number?>, control: C, required: Boolean = false, validatorMessage: (C) -> String? = null, validator: (C) -> Boolean? = null): FormPanel<K>
+Adds a number control to the form panel.
+open fun <C : DateFormControl> add(key: KProperty1<K, Date?>, control: C, required: Boolean = false, validatorMessage: (C) -> String? = null, validator: (C) -> Boolean? = null): FormPanel<K>
+Adds a date control to the form panel.
fun <C : FormControl> addInternal(key: KProperty1<K, *>, control: C, required: Boolean = false, validatorMessage: (C) -> String? = null, validator: (C) -> Boolean? = null): FormPanel<K>
operator fun get(key: String): Any?
+operator fun get(key: KProperty1<K, *>): Any?
Returns a value of the control of given key.
open fun getControl(key: String): FormControl?
+open fun getControl(key: KProperty1<K, *>): FormControl?
Returns a control of given key.
open fun remove(key: String): FormPanel<K>
+open fun remove(key: KProperty1<K, *>): FormPanel<K>
Removes a control from the form panel.
open fun remove(key: String): FormPanel<K>
+
+open fun remove(key: KProperty1<K, *>): FormPanel<K>
Removes a control from the form panel.