From 2c4fe2ef6fd0a0bfa53f6496a1d4bede8fe9219d Mon Sep 17 00:00:00 2001 From: Robert Jaros Date: Tue, 16 Jan 2018 15:12:55 +0100 Subject: Radio button group form control --- src/main/kotlin/pl/treksoft/kvision/Showcase.kt | 31 +++++- .../kotlin/pl/treksoft/kvision/form/FieldLabel.kt | 2 +- .../pl/treksoft/kvision/form/check/RadioGroup.kt | 118 +++++++++++++++++++++ 3 files changed, 146 insertions(+), 5 deletions(-) create mode 100644 src/main/kotlin/pl/treksoft/kvision/form/check/RadioGroup.kt (limited to 'src/main/kotlin/pl') diff --git a/src/main/kotlin/pl/treksoft/kvision/Showcase.kt b/src/main/kotlin/pl/treksoft/kvision/Showcase.kt index a27fae2d..dfdc5b6b 100644 --- a/src/main/kotlin/pl/treksoft/kvision/Showcase.kt +++ b/src/main/kotlin/pl/treksoft/kvision/Showcase.kt @@ -13,6 +13,7 @@ import pl.treksoft.kvision.form.INPUTSIZE import pl.treksoft.kvision.form.bool import pl.treksoft.kvision.form.check.CheckBox import pl.treksoft.kvision.form.check.Radio +import pl.treksoft.kvision.form.check.RadioGroup import pl.treksoft.kvision.form.date import pl.treksoft.kvision.form.select.AjaxOptions import pl.treksoft.kvision.form.select.SELECTWIDTHTYPE @@ -63,7 +64,7 @@ class Showcase : ApplicationBase() { val ret = form.getData() console.log(ret) - class DataFormMap(val map: Map) { + class DataFormMap(map: Map) { val name: String by map val age: Date by map } @@ -165,6 +166,24 @@ class Showcase : ApplicationBase() { } root.add(mbuttons3) + val rg = RadioGroup(listOf("o1" to "Pierwsza opcja", "o2" to "Druga opcja"), label = "Radio buttony") + root.add(rg) + val rgbutton = Button("Sprawdź radio").setEventListener