From d8cd67062b8de6e8398dc6dfd00d201200c82414 Mon Sep 17 00:00:00 2001 From: Robert Jaros Date: Fri, 9 Feb 2018 13:40:35 +0100 Subject: API doc and readme --- docs/api/pl.treksoft.kvision.form/-form/index.html | 123 +++++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 docs/api/pl.treksoft.kvision.form/-form/index.html (limited to 'docs/api/pl.treksoft.kvision.form/-form/index.html') diff --git a/docs/api/pl.treksoft.kvision.form/-form/index.html b/docs/api/pl.treksoft.kvision.form/-form/index.html new file mode 100644 index 00000000..678f3d2b --- /dev/null +++ b/docs/api/pl.treksoft.kvision.form/-form/index.html @@ -0,0 +1,123 @@ + + + +Form - kvision + + + +kvision / pl.treksoft.kvision.form / Form
+
+

Form

+class Form<K> +

The form definition class. Can be used directly or indirectly inside a FormPanel.

+

Constructors

+ + + + + + + +
+

<init>

+
+Form(panel: FormPanel<K>? = null, modelFactory: (Map<String, Any?>) -> K) +

Creates a form with a given modelFactory function

+
+

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

add

+
+fun <C : FormControl> add(key: String, control: C, required: Boolean = false, validatorMessage: (C) -> String? = null, validator: (C) -> Boolean? = null): Form<K> +

Adds a control to the form.

+
+

clearData

+
+fun clearData(): Unit +

Sets the values of all controls to null.

+
+

get

+
+operator fun get(key: String): Any? +

Returns a value of the control of given key.

+
+

getControl

+
+fun getControl(key: String): FormControl? +

Returns a control of given key.

+
+

getData

+
+fun getData(): K +

Returns current data model.

+
+

getDataJson

+
+fun getDataJson(): Json +

Returns current data model as JSON.

+
+

remove

+
+fun remove(key: String): Form<K> +

Removes a control from the form.

+
+

removeAll

+
+fun removeAll(): Form<K> +

Removes all controls from the form.

+
+

setData

+
+fun setData(model: K): Unit +

Sets the values of all the controls from the model.

+
+

validate

+
+fun validate(): Boolean +

Invokes validator function and validates the form.

+
+ + -- cgit