Skip to main content
Version: 7.9

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

NameDescriptionProperty TypeScriptingCategory
AntialiasDraw with antialias on? Makes text smoother.boolean.antialiasAppearance
BackgroundThe background color of the text box (when editable).Color.editableBackgroundAppearance
BorderThe border surrounding this component. NOTE that the border is unaffected by rotation.Border.borderCommon
Commit On Focus LossIf 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.commitOnFocusLostBehavior
CursorThe mouse cursor to use when hovering over this component.int.cursorCodeCommon
Data QualityThe data quality code for any tag bindings on this component.int.dataQualityData
Decimal FormatThe formatting string used for displaying numbers.String.decimalFormatAppearance
Defer UpdatesWhen true, the value properties will not fire updates while typing, it will wait for Enter to be pressed.boolean.deferUpdatesBehavior
Editable?If true, this is an input box, if false, this is display-only.boolean.editableBehavior
EnabledIf disabled, a component cannot be used.boolean.componentEnabledCommon
Error on Out-of-BoundsShow an error message if the user input is out-of-bounds?boolean.errorOnOutOfBoundsBehavior
FontFont of text on this component.Font.fontAppearance
Foreground ColorThe foreground color of the component.Color.foregroundAppearance
Horizontal AlignmentDetermines the alignment of the label's contents along the X axis.int.horizontalAlignmentLayout
MaximumThe maximum value (inclusive), if useBounds is true.double.maximumData
MinimumThe minimum value (inclusive), if useBounds is true.double.minimumData
Mouseover TextThe text that is displayed in the tooltip which pops up on mouseover of this component.String.toolTipTextCommon
NameThe name of this component.String.nameCommon
Non-Editable BackgroundThe background color to use when this text box is non-editableColor.nonEditableBackgroundAppearance
Number TypeWhat type of numbers should this field accept?int.modeData
Out Of Bounds MessageThe error message to display if input is out-of-bounds.String.outOfBoundsMessageBehavior
Protected Mode?If true, users will need to double-click in the field in order to edit the value.boolean.protectedModeBehavior
Reject Updates During EditIf true, this field will not accept updates from external sources (like DB bindings) while the user is editing the field.boolean.rejectUpdatesDuringEditBehavior
StylesContains the component's styles.Dataset.stylesAppearance
SuffixA string to display after the value.String.suffixAppearance
Touchscreen ModeControls when this input component responds if touchscreen mode is enabled.int.touchscreenModeBehavior
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.useBoundsBehavior
Value (Double)The value as a double. Make sure you use the value property that corresponds to your Number Type setting.double.doubleValueData
Value (Float)The value as a float. Make sure you use the value property that corresponds to your Number Type setting.float.floatValueData
Value (Integer)The value as an integer. Make sure you use the value property that corresponds to your Number Type setting.int.intValueData
Value (Long)The value as a long. Make sure you use the value property that corresponds to your Number Type setting.long.longValueData
VisibleIf disabled, the component will be hidden.boolean.visibleCommon

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

Code Snippet
#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 NameValue
BorderField Border
Number TypeFloat
FontDialog, BoldItalic, 15
Decimal Format#,##0.00