From c9f98dfdbdc3f56553b58dc226b3f841189d0fc0 Mon Sep 17 00:00:00 2001
From: Robert Jaros Adds a control to the form. Adds a string control to the form.
add
-
-fun <C : FormControl> add(key: String, control: C, required: Boolean = false, validatorMessage: (C) -> String? = null, validator: (C) -> Boolean? = null): Form<K>
-fun <C : StringFormControl> add(key: KProperty1<K, String?>, control: C, required: Boolean = false, validatorMessage: (C) -> String? = null, validator: (C) -> Boolean? = null): Form<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
fun <C : BoolFormControl> add(key: KProperty1<K, Boolean?>, control: C, required: Boolean = false, validatorMessage: (C) -> String? = null, validator: (C) -> Boolean? = null): Form<K>
+Adds a boolean control to the form.
+
+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
fun <C : NumberFormControl> add(key: KProperty1<K, Number?>, control: C, required: Boolean = false, validatorMessage: (C) -> String? = null, validator: (C) -> Boolean? = null): Form<K>
+Adds a number control to the form.
+
+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
fun <C : DateFormControl> add(key: KProperty1<K, Date?>, control: C, required: Boolean = false, validatorMessage: (C) -> String? = null, validator: (C) -> Boolean? = null): Form<K>
+Adds a date control to the form.
+
+key
- key identifier of the control
+control
- the date form control