GraffitiTextField

Enumerations #

NameValues
AlignmentsLeft
Right
Center
CaseModifiersNone
Lower
Upper
EnterKeyHintsEnter
Done
Go
NextFocus
PreviousFocus
Search
Send
FieldTypesText
Color
Date
DateTime
DateTimeLocal
Email
Number
Password
Telephone
Time
Url
Week
PositionsLeft
Right
StatesUnvalidated
Valid
Invalid

Constants #

This class exposes no constants.

Events #

DefinitionParametersReturn TypeDescription
EnterPressedNoneNoneRaised when the user presses the Enter key on their keyboard while the field has focus. Simultaneously updates the value server-side. Prevents Default button action.
LabelPressedNoneNoneRaised when the user clicks the label.
StateChangedNoneNoneRaised when the user’s text has changed the State of the field based on the supplied Pattern.
ValueChangedNoneNoneRaised when the user changes the value of the field.

Methods #

DefinitionParametersReturn TypeDescription
AddValuevalue as StringNoneAdds a new value to the autocomplete array.
AddValueAtindex as Integer
value as String
NoneAdds a new value to the autocomplete array at the specified index.
IndexOfValuevalue as StringIntegerReturns the index of the specified value within the autocomplete array.
LastValueIndexNoneIntegerReturns the index of the last item within the autocomplete array.
RemoveAllValuesNoneNoneRemoves all values from the autocomplete array.
RemoveValueAtindex as IntegerNoneRemoves the value at the specified index from the autocomplete array.
SelectAllNoneNoneSelects all content within the field.

Properties #

NameTypeDefault ValueDescription
AutocompleteHighlightTypedBooleanTrueHighlights typed text within the autocomplete results dropdown.
AutocompleteMaximumItemsInteger5Maximum number of items to display in the autocomplete results dropdown.
AutocompleteSearchThresholdInteger2Number of characters required to be input for autocomplete to process.
CaseModifierCaseModifiersNoneControls the capitalization of value text. Also applies to Placeholder.
EnterKeyHintEnterKeyHintsEnterText to display in the Enter button of mobile/virtual keyboards.
FieldStyleGraffitiStyleNilStyle applied to the field portion of the class.
IconHeightInteger16Height of IconObject when specified.
IconObjectPictureNilCustom icon displayed in the label portion. Signify location using <icon> in Label text.
IconWidthInteger16Width of IconObject when specified.
LabelString“Untitled”Caption of the label portion of the control. Supports FontAwesome icons, IE: <fas fa-search>
LabelAlignmentGraffitiTextField.AlignmentsLeftAlignment of text and icons in the label portion of the field.
LabelPositionPositionsLeftThe location of the label in relation to the field.
LabelStyleGraffitiStyleNilStyle applied to the label portion of the class.
LabelVisibleBooleanTrueWhen False, only the text field portion of the component will be displayed.
LabelWidthInteger-1Static width of label portion. -1 for auto.
MaxLengthInteger-1Maximum number of characters that the field can contain. Set to -1 for the maximum HTML limit of 524288.
MultilineBooleanFalseWhen True, the user may enter multiple lines of text within the component. Some other features or functionality may not be operational under these conditions due to browser limitations.
PatternString“”For using the browser’s built-in RegEx validation (https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern).
PatternInvalidMessageString“”Text to display when the entered text does not confirm to the supplied Pattern. Empty string uses browser default.
PatternSetsStateBooleanTrueDetermines whether the conformity of the input text to the supplied Pattern will change the State of the control to be visibly valid or invalid.
ReadOnlyBooleanFalseIf True users cannot edit the contents of the field.
RequiredBooleanFalseDenotes within the display that this field is required.
SelectionLengthInteger0Length of the currently selected text.
SelectionStartInteger0Start position of the current selection.
StateStatesUnvalidatedThe validation state of the field.
TypeFieldTypesTextThe type of field, not all types are supported by all browsers.
ValueString“”The value of the field. Updates on focus loss to reduce communication with the server.

Examples #

State #

This snippet changes the state of the field based on the length of the field’s text:

if me.Value.Length > 3 then
  me.State = GraffitiTextField.States.Valid
elseif me.Value.Length <> "" then
  me.State = GraffitiTextField.States.Invalid
else
  me.State = GraffitiTextField.States.Unvalidated
end if

Notes #

Mask Definitions #

CharacterAccepted Inputs
aAlpha character (a-z, A-Z)
9Numeric character (0-9)
*Alphanumeric character (a-z, A-Z, 0-9)
?Anything after the question mark is considered optional, and the MaskComplete event will fire with or without that section being filled.