Text Field
Component Palette Icon:
Description
The Text Field component is used for input of any single-line text. This component will accept any alpha-numeric input. If you're looking for a numeric field, see the Numeric Text Field.
This field features a protected mode. When you enable the protectedMode 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 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
Name | Description | Property Type | Scripting | Category |
---|---|---|---|---|
Antialias | Draw with antialias on? Makes text smoother. | boolean | .antialias | Appearance |
Background | The background color of the text box (when editable). | Color | .editableBackground | Appearance |
Border | The border surrounding this component. NOTE that the border is unaffected by rotation. | 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. | int | .cursorCode | Common |
Data Quality | The data quality code for any tag bindings on this component. | int | .dataQuality | Data |
Defer Updates | When true, the 'text' property 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 |
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 Characters | The text box will be limited to this number of characters. Use -1 for unlimited. | int | .maxChars | Behavior |
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 |
Protected Mode? | If true, users will need to double-click in the field in order to edit the text. | boolean | .protectedMode | Behavior |
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 |
Text | Text of this component. | String | .text | Data |
Touchscreen Mode | Controls when this input component responds if touchscreen mode is enabled. | int | .touchscreenMode | Behavior |
Visible | If disabled, the component will be hidden. | boolean | .visible | Common |
Scripting
Scripting Functions
getSelectedText()
- Description
- Returns the currently selected or highlighted text in the text field.
- Parameters
- Nothing
- Return
- String - Returns the currently selected or highlighted text in the text field.
- Scope
- Client
Extension Functions
This component does not have extension functions associated with it.
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 code will return the value of the text box's previous value into a variable.
#This code is fired on the propertyChange event for this component.
oldValue = event.source.oldValue
Titled Panel
Property Name | Value |
---|---|
Border | Tabbed Border with Title |
Font | Dialog, Bold, 12 |
Horizontal Alignment | Center |