Vision - Numeric Text Field
Component Palette Icon
The Numeric Text Field is similar to the standard Text Field, except that it is specialized for use with numbers. Instead of a "text" property, it has four numeric "value" properties. Which one you use depends on the mode of the text box.
Like the standard Text Field, this text field can operate in protected mode. When you enable the protected property, the field is not editable even when it receives input focus. The user must double click on the field or press enter in order to edit the field. When they are done (press enter again or leave the field), the field becomes non-editable again.
The Numeric Text Field also supports the reject updates during edit feature. This feature ignores updates coming from property bindings while the component is being edited by a user.
Properties​
Property | Description | Property Type | Scripting | Category |
---|---|---|---|---|
Background | The background color of the text box (when editable). | Color | .editableBackground | Appearance |
Border | The border surrounding this component. No border, Etched (Lowered), Etched (Raised), Bevel (Lowered), Bevel (Raised), Bevel (Double), Field Border, and Line Border. Note: The border is unaffected by rotation. Changed in 8.1.21 As of 8.1.21, the "Button Border" and "Other Border" options are removed. | Border | .border | Common |
Commit On Focus Loss | If true, any pending edit will take effect when focus is lost. If false, the user must press Enter for an edit to take effect. | boolean | .commitOnFocusLost | Behavior |
Cursor | The mouse cursor to use when hovering over this component. Options are: Default, Crosshair, Text, Wait, Hand, Move, SW Resize, or SE Resize. | int | .cursorCode | Common |
Decimal Format | The formatting string used for displaying numbers. | String | .decimalFormat | Appearance |
Defer Updates | When true, the value properties will not fire updates while typing, it will wait for Enter to be pressed. | boolean | .deferUpdates | Behavior |
Editable? | If true, this is an input box, if false, this is display-only. | boolean | .editable | Behavior |
Enabled | If disabled, a component cannot be used. | boolean | .componentEnabled | Common |
Error on Out-of-Bounds | Show an error message if the user input is out-of-bounds? | boolean | .errorOnOutOfBounds | Behavior |
Font | Font of text on this component. | Font | .font | Appearance |
Foreground Color | The foreground color of the component. | Color | .foreground | Appearance |
Horizontal Alignment | Determines the alignment of the label's contents along the X axis. | int | .horizontalAlignment | Layout |
Maximum | The maximum value (inclusive), if useBounds is true. | double | .maximum | Data |
Minimum | The minimum value (inclusive), if useBounds is true. | double | .minimum | Data |
Mouseover Text | The text that is displayed in the tooltip which pops up on mouseover of this component. | String | .toolTipText | Common |
Name | The name of this component. | String | .name | Common |
Non-Editable Background | The background color to use when this text box is non-editable | Color | .nonEditableBackground | Appearance |
Number Type | What type of numbers should this field accept? | int | .mode | Data |
Out Of Bounds Message | The error message to display if input is out-of-bounds. | String | .outOfBoundsMessage | Behavior |
Protected Mode? | If true, users will need to double-click in the field in order to edit the value. | boolean | .protectedMode | Behavior |
Quality | The data quality code for any Tag bindings on this component. | QualityCode | .quality | Data |
Reject Updates During Edit | If true, this field will not accept updates from external sources (like DB bindings) while the user is editing the field. | boolean | .rejectUpdatesDuringEdit | Behavior |
Styles | Contains the component's styles. | Dataset | .styles | Appearance |
Suffix | A string to display after the value. | String | .suffix | Appearance |
Touchscreen Mode | Controls when this input component responds if touchscreen mode is enabled. | int | .touchscreenMode | Behavior |
Use Bounds? | Only allows user-entered values between a minimum and maximum. Unless you turn on "Error on out-of-bounds", user-entered values will be silently modified to be in-bounds. | boolean | .useBounds | Behavior |
Value (Double) | The value as a double. Make sure you use the value property that corresponds to your Number Type setting. | double | .doubleValue | Data |
Value (Float) | The value as a float. Make sure you use the value property that corresponds to your Number Type setting. | float | .floatValue | Data |
Value (Integer) | The value as an integer. Make sure you use the value property that corresponds to your Number Type setting. | int | .intValue | Data |
Value (Long) | The value as a long. Make sure you use the value property that corresponds to your Number Type setting. | long | .longValue | Data |
Visible | If disabled, the component will be hidden. | boolean | .visible | Common |
Deprecated Properties​
Property | Description | Property Type | Scripting | Category |
---|---|---|---|---|
Data Quality | The data quality code for any Tag bindings on this component. | int | .dataQuality | Deprecated |
Scripting​
See the Vision - Numeric Text Field Scripting Functions page for the full list of scripting functions available for this component.
Event Handlers​
Event handlers allow you to run a script based off specific triggers. See the full list of available event handlers on the Component Events page.
Customizers​
Examples​
#The following script can be executed on a mouse released event handler.
#This would write the selected text to a custom property called highlightedText.
event.source.highlightedText = event.source.getSelectedText()
2-digit Numeric Format​
Property Name | Value |
---|---|
Border | Field Border |
Number Type | Float |
Font | Dialog, BoldItalic, 15 |
Decimal Format | #,##0.00 |