[Control] numField
Part of: mobl::ui::generic
Arguments:
n : Numvariable/property to bind the control to.label : String = nulllabel text (optional)validator : Function1<Num,String> = alwaysOkValidatorvalidator function, takesnas argument and returns error message or empty string if OK (optional)style : Style = textFieldStylethe style to use for the fieldinvalidStyle : Style = textFieldInvalidStylethe style to use for the field on invalid inputautofocus : Bool = falsewhether the control should get immediately get focus when loaded.step : Numstep sizemax : Nummaximum valuemin : Numminimum valueonchange : Callback = nullevent triggered when the text field changed and loses focus (optional).onkeyup : Callback = nullevent triggered on every keypress (optional).
A numeric input field control.
Example:
var age = 27
group {
item { numField(age, label="Age") }
}
Example 2:
function validateAge(n : String) : String {
return n >= 18 ? "" : "You have to be at least 18";
}
...
group {
item { numField(age, validator=validateAge) }
}
mobl/ui/generic/numfield.txt · Last modified: 2013/10/01 02:29 (external edit)
