Field
The Field object is a multifunctional, editable input.
It supports various data types, providing flexibility for different input
scenarios:
-
Text (Default): A single-line text field for general input
-
Multiline: A multi-line text field, suitable for longer descriptions or notes
-
Date: date values
-
Time: time values
-
Keypad: a numeric keypad for code entry
-
Select: presents a selection list of options
The field value is sent as a command to the server:
-
when the user changes it, if
Auto Send
it true -
when a button with
submit
action is pressed (sending multiple fields at once)
Attributes
Common
ID
Sets the object's ID.
The ID identifies the object and is used to reference it in UISet actions, allowing to change its attributes dynamically.
The ID is not unique, it can be shared among multiple objects to quickly change a common attribute.
IDs can't be changed with a UISet action, but they can have a Value Binding assigned to them. Value Bindings on IDs allow an object to be dinamically attached to a set of attribute values.
E.g. the following Value Binding switches the ID of the object between mybutton1
and mybutton2
based on the value of the UISet button.address
:
Value binding:
="mybutton" + ui('button', 'address')
UISet:
UISet('button', 'address', '1')
switches the ID to mybutton1
UISet('button', 'address', '2')
switches the ID to mybutton2
Position and Size
Position
Sets the object's position.
The default
value is: x0y0
.
Attribute Values
Value | Description | Example |
---|---|---|
x<left>y<top> | Specify left/top coordinates in pixels. | x10y20 |
Flex Grow
Specifies if the objects should grow to fill the available space.
The default
value is: true
.
Attribute Values
Value | Description |
---|---|
true | Default value. Objects expand to fill the available space. |
false | Objects do not grow to fill the available space. |
Flex Shrink
Specifies if the objects should shrink to fit the available space.
The default
value is: true
.
Attribute Values
Value | Description |
---|---|
true | Default value. Objects shrink to fit the available space. |
false | Objects do not shrink to fit the available space. |
Width
Sets the object's width in pixels.
Minimum value is 1.
Height
Sets the object's height in pixels.
Minimum value is 1.
Field
Name
Specifies the name of the field, used to send a command to the server, along with the field's value as a parameter.
If the name starts with $, then the server will automatically set a variable with the same name as the command, containing the command's parameter.
The default
value is: =id
.
Attribute Values
Value | Description | Example |
---|---|---|
<string> | Command name. | |
$[variable name] | A command name that sets a variable. | $myvar |
$[variable name]! | A command name that sets a persistent variable. | $myvar! |
Value
Specifies the field's value.
Placeholder
Specifies a short hint that describes the expected value of the field (e.g. a sample value or a short description of the expected format).
The short hint is displayed in the input field before the user enters a value.
Attribute Values
Value | Description |
---|---|
<string> | Placeholder text. |
Read Only
Specifies if the field is read only.
The default
value is: false
.
Attribute Values
Value | Description |
---|---|
false | Default value. Can be written by the user. |
true | Can't be written by the user (can still be changed with a uiSet). |
Auto Send
Specifies whether the value is automatically sent on change or is sent through a button with submit action.
The default
value is: auto
.
Attribute Values
Value | Description |
---|---|
auto | Default value. The value is sent only if there's no buttons with submit action in the same or a parent container. |
true | The value is sent automatically on change. |
false | The value is not automatically sent. |
Feedback
If feedback is enabled, when the action is performed, a loader is displayed until the server responds.
Also the action can't be performed again until the server responds.
The default
value is: false
.
Attribute Values
Value | Description |
---|---|
false | Default value. Feedback is disabled. |
true | Feedback is enabled. |
Change Delay
Sets the delay in milliseconds by which changes are detected. If the field is working in autosend mode, this value determines the delay between the last button press and the value being sent to the server.
Clear Button
Show a clear button that clears the field's value.
The default
value is: false
.
Attribute Values
Value | Description |
---|---|
true | Show the clear button when there's any value set. |
false | Default value. Hide the clear button. |
Type
Type
Specifies the type of the field.
The default
value is: text
.
Attribute Values
Value | Description |
---|---|
text | Default value. Single line text field. |
multiline | Multiline text field. |
date | Date field. |
time | Time field. |
time-interval | Time interval field. |
keypad | Keypad field. |
select | Select field. |
Min
Specifies the minimum value allowed.
Attribute Values
Value | Description |
---|---|
<string> | Minimum value. |
Max
Specifies the maximum value allowed.
Attribute Values
Value | Description |
---|---|
<string> | Maximum value. |
Digits
Specifies the number of digits allowed.
Attribute Values
Value | Description |
---|---|
auto | Any number of digits. |
<int> | Maximum number of digits. |
Decimals
Specifies the number of decimals allowed.
The default
value is: 0
.
Attribute Values
Value | Description |
---|---|
<int> | Number of decimals. |