aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/pl/treksoft/kvision/form
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/pl/treksoft/kvision/form')
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/form/check/CheckInput.kt8
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/form/text/AbstractTextInput.kt9
2 files changed, 9 insertions, 8 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/form/check/CheckInput.kt b/src/main/kotlin/pl/treksoft/kvision/form/check/CheckInput.kt
index 0184c779..6973efe9 100644
--- a/src/main/kotlin/pl/treksoft/kvision/form/check/CheckInput.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/form/check/CheckInput.kt
@@ -51,6 +51,7 @@ abstract class CheckInput(
) : Widget(classes), FormInput {
init {
+ this.vnkey = "kv_checkinput_${counter++}"
this.setInternalEventListener<CheckInput> {
click = {
val v = getElementJQuery()?.prop("checked") as Boolean?
@@ -129,10 +130,6 @@ abstract class CheckInput(
refreshState()
}
- override fun afterPostpatch(node: VNode) {
- refreshState()
- }
-
private fun refreshState() {
val v = getElementJQuery()?.prop("checked") as Boolean?
if (this.value != v) {
@@ -166,4 +163,7 @@ abstract class CheckInput(
getElementJQuery()?.blur()
}
+ companion object {
+ internal var counter = 0
+ }
}
diff --git a/src/main/kotlin/pl/treksoft/kvision/form/text/AbstractTextInput.kt b/src/main/kotlin/pl/treksoft/kvision/form/text/AbstractTextInput.kt
index 3a06f47b..c9ea2dba 100644
--- a/src/main/kotlin/pl/treksoft/kvision/form/text/AbstractTextInput.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/form/text/AbstractTextInput.kt
@@ -41,6 +41,7 @@ abstract class AbstractTextInput(
) : Widget(classes), FormInput {
init {
+ this.vnkey = "kv_textinput_${counter++}"
this.setInternalEventListener<AbstractTextInput> {
input = {
self.changeValue()
@@ -127,10 +128,6 @@ abstract class AbstractTextInput(
refreshState()
}
- override fun afterPostpatch(node: VNode) {
- refreshState()
- }
-
/**
* @suppress
* Internal function
@@ -170,4 +167,8 @@ abstract class AbstractTextInput(
open fun blur() {
getElementJQuery()?.blur()
}
+
+ companion object {
+ internal var counter = 0
+ }
}