textField
fun <T> textField(pattern: Regex = Regex(".*"), encoder: Encoder<T, String>, validator: (T) -> Boolean = { true }, config: TextFieldConfig<T>.() -> Unit = {}): FieldVisualizer<T>(source)
Creates a TextField control that is bounded to a Field. The associated field will only be valid if the text field's input matches pattern and encoder.decode produces a valid T from it.
Parameters
T
is the type of the bounded field
pattern
used to validate input to the field
validator
used to validate value from encoder
config
used to control the resulting component
fun textField(pattern: Regex = Regex(".*"), validator: (String) -> Boolean = { true }, config: TextFieldConfig<String>.() -> Unit = {}): FieldVisualizer<String>(source)
Creates a TextField control that is bounded to a Field (of type String). The associated field will only be valid if the text field's input matches pattern.
Parameters
pattern
used to validate input to the field
validator
used to validate value after pattern
config
used to control the resulting component