The text field widget is a basic labeled input widget with a small area for text representing an int, decimal or string basic data type.
Is allows for binding of values to basic variables or attributes of objects instances in a unit.
It also allows for binding to a variable, object instance attribute or function in order to determine if the widget is hidden or not.
The title is specified as a key to a lang file entry and is required.
In addition, the text field widget provides a datatype attribute that can be used to slightly alter the behaviour of the text field widget. Possible values and their related behaviour is as follows:
datatype="number"
Allows only numbers to be entered. Provides scroller buttons that increment and decrement the current value.
datatype="password"
Displays a * character instead of the characters entered by the user in order to hide a password.
datatype="text"
Default behaviour assuming the widget is bound to a basic data type that is not of type int.
Note that when the text field is bound to a variable of type int it will behave as though datatype="number" has been specified even though it hasn't.
Example
Implied number datatype
The abbreviated code snippets and screenshot below shows the use of <textfield/> with a value binding to an object instance attribute and a visibility binding to a unit function. It uses the default datatype behaviour.
Add Comment