jschneider
02/12/2021, 11:25 AMRobert Jaros
02/12/2021, 11:59 AMval text = text()
button("invalid").onClick {
text.validationStatus = ValidationStatus.INVALID
}
button("valid").onClick {
text.validationStatus = ValidationStatus.VALID
}
button("normal").onClick {
text.validationStatus = null
}
Robert Jaros
02/12/2021, 12:01 PMRobert Jaros
02/12/2021, 12:05 PMtext-danger
class but works for me as well:
val text = text()
button("error").onClick {
text.validatorError = "error message"
}
button("normal").onClick {
text.validatorError = null
}
jschneider
02/12/2021, 12:53 PMval text = text().apply{
label = "daLabel"
}
button("invalid").onClick {
text.validationStatus = ValidationStatus.INVALID
text.validatorError = "Not a number!"
}
button("valid").onClick {
text.validationStatus = ValidationStatus.VALID
}
button("normal").onClick {
text.validationStatus = null
}
jschneider
02/12/2021, 12:54 PMjschneider
02/12/2021, 12:55 PMjschneider
02/12/2021, 12:56 PMRobert Jaros
02/12/2021, 1:19 PMvalidationStatus
is a property of input controls (e.g. TextInput
), which don't contain labels and error messages. It's marked with border color only. validatorError
, on the other hand, is a property of form controls (e.g. Text
) which have labels and error messages. So if you want to show error text for form control use validatorError
(it sets validationStatus
automatically on the inner input). If you just want colored border use validationStatus
(it's available for both types of control).