A text box control, sometimes called an edit field or edit control, can display information entered in the JADE development environment, entered by the user, or assigned to the control by logic at run time.
As the TextBox class is a subclass of the Control class, it inherits all of the properties and methods defined in the Control and Window classes. The TextBox class provides the WebHTML subclass.
The TextBox class validates the setting and entry of text based on the dataType property value, using the current locale of the client with regional overrides on both the presentation client and the application server when the
By setting appropriate property values, the text box control can:
Be a single-line data entry text box
Be a multiple-line data entry text box
Allow the word wrap feature (implied when the scrollHorizontal property is set to false)
Allow scrolling of the text both horizontally and vertically
For details about the support of mouse wheel requests to scroll up, down, or across a text box control, see "Window Class", earlier in this document.
Align the text left, right, or centrally
Be a password entry text box, where the characters entered are displayed as asterisk (*) characters
Be declared as a numeric text box, preventing the entry of invalid characters or non-numeric characters
Can automatically convert the case of the entered characters
Can be a read-only display text box
Use the firstChange event to move logic from other key events when that logic is relevant only to the first time the text changes. (This reduces the number of events that must be sent and processed for each key that is pressed.)
The text box is always created as a multiple line text box, unless the passwordField property is set to true. In a text box, CrLf and Lf are recognized as end-of-line sequences.
The text box functions as a single-line text box when:
The height of the text box leaves room only for one line of text to be displayed and the scrollVertical property is set to false
The dataType property is set to that of a numeric text box
Control the functionality of the text box as a multiple-line control by setting the scrollHorizontal, scrollVertical, and scrollBars properties. If the scrollHorizontal property is set to true, word wrapping does not occur, and each line must be terminated by the ENTER key. If the scrollVertical property is set to false, the entry of text is limited to the number of visible text lines.
The text box does not receive tab characters from Windows unless the text box is the only enabled visible control that has the tabStop property set, as the tab functions is interpreted by Windows as a skip to the next text box. If there is no other text box to tab to, the character is passed to the text box. Use CTRL+TAB to enter a tab when the tab is interpreted as a control skip.
The text box does not respond to the ENTER key if an enabled and visible default button is defined on the same form.
If the text box is defined as numeric data type, the text cannot be set to a value that is an invalid numeric (according to the dataType, decimals, and maxLength properties). Additionally, as each character is entered, the character is rejected with a beep if the resulting text would result in an invalid number (including the deletion of a character).
If the case property is set to Case_UpperFirst (3) or Case_LowerFirst (4), the text box control accepts only an alphabetic character as the first character entered in the text box and automatically changes the case of the entered character to the required type, if applicable. If the case property is set to any value other than the default value of Case_None (0), the dataType property is set to the default value of DataType_AlphaNumeric (0) and the decimals property is set to zero (0); that is, no exception is raised.
A text box automatically handles the clipboard copy, cut, and paste key sequences (that is, CTRL+INSERT, CTRL+C, CTRL+DELETE, CTRL+X, and SHIFT+INSERT).
If text is pasted into or cut from a text box and the resulting text is no longer valid according to the automatic validation rules, the text in the text box is cleared; for example, when pasting non-numeric text into a numeric text box. This ensures that JADE logic can always assume the resulting text complies with the validation rules. This situation occurs only with paste or cut operations that involve numeric text boxes and when the first character must be alphabetic (case property). When data is entered from the keyboard, the validation rules are applied, and the entered character is ignored (with a beep) if the resulting text would be invalid.
When text with trailing carriage return and line feed characters (the CrLf end-of-line sequence) is pasted after the current text of a text box, the CrLf characters are removed if the:
Resulting text would be invalid (for example, pasting '1234' followed by a CrLf character into a numeric text box results in '1234' only being pasted)
Text box has the scrollVertical property set to false and the CrLf characters would cause the number of lines of text to exceed the height of the available area in the text box (for example, pasting 'No' followed by a CrLf character into a single-line text box with the scrollVertical property set to false results in 'No' being pasted)
To implement the handling of a TextBox control to achieve the same functionality as the default Table class InputType_TextBox value, only the following is required.
In the change event for the text box:
table1.text := textbox1.text
In the cellInputReady event for the table:
textbox1.text := table1.text
For more details, see the Table class inputType and cellControl properties. See also the Control class automaticCellControl property and "Value Round Trips through TextBox Controls", elsewhere in this document. For a summary of the constants, properties, methods, and events defined in the TextBox class, see "TextBox Class Constants", "TextBox Properties", "TextBox Methods", and "TextBox Events", in the following subsections.