Class: com.ibm.dse.gui.SpTextField
Extends: java.swing.JTextField
Implements:
com.ibm.dse.gui.DataExchanger
The SpTextField class has the following
properties:
- alternativeDataName: A data element name defined in the context. Its type
must correspond to the type expected by the text field. If this property is
set, the Bean's DSECoordinatedPanel will write to the specified dataElement
whenever it writes to the date element specified by the dataName property.
Both data elements will contain the same value after the first writes are
done.
- autoClear: Boolean. If true, the text in the bean is selected when the
bean gets focus.
- autoTab: Boolean. If true, focus is transferred to the next component
in the panel when the length of the text in the bean is equal to the maxChars
property.
- BeansReactions: A class name. When a bean changes states and the end state
is a non-error state, the bean will call the beanReaction(java.awt.Component)
static method of the specified class.
- colors: Allows different colors for mandatory, background, or foreground,
etc., to be specified, overriding those defined in Settings.
- dataName: A data element defined in the context or operation context.
Its type must correspond to the type expected by the text field formatter.
DSECoordinatedPanel will read and write to this data element.
- dataToClear: Clears the data exchangers according to the value in the
dataDirection property, which can be Input, Output, or Both. Applicable to
the Clear button type.
- formatter: The class responsible for validating and formatting the entry
field contents. The following data can be customized:
- Formatter. Can be
either null, one of the provided formatters (Numeric, Integer, Float, or
Date), or a formatter
developed by the user.
- Error message. The message to be displayed when validation fails. Data
related to the selected formatter (for example, the date separator and the
date pattern for the Date formatter).
- euro-EMUConvertible. Enabled only if the formatter is null or FloatConverter.
If it is selected, data in the entry field will be converted to the appropriate
currency when the Euro or EMUCurrency button is clicked. Data is not converted
if one of the following conditions applies:
- The formatter is null and the data in the text field is not a number (with
or without a decimal separator).
- The formatter is FloatConverter and the text field data is wrong.
Initial data entered by the user in the source currency is stored
by the system. Then, when converting back from the target currency to the
source currency, this value is used instead of making a conversion for precision,
in order to avoid rounding errors.
There is an alternative to using
a formatter to format and validate the value. This bean can use the descriptor
validation in the dataElement. If both alternatives exist then the bean will
test validity using both validations, but it will be formatted from the view
properties.
- helpId: Identifier for the online help function. The help text associated
with this property is shown when the Help key is pressed. If this property
is not defined, the HelpId of the panel where the button is located is used.
If that panel's helpId property is not defined, the parent panels are searched
recursively until the property is found or the DSECoordinatedPanel is reached.
If the helpID value is not found at the DSECoordinatedPanel, null is used.
This property can also be defined in the dataElement descriptor (the name
of this descriptor is helpID). If it is defined in the view, this value will
be the helpId property value.
- keystroke: Boolean. If true, each key typed will invoke a validation method
in the associated formatter.
- maxChars: Maximum number of characters allowed in the text field once
it is formatted. If autoTab is false, extra characters are ignored and a warning
beep sounds.
- mandatory: Boolean. If true, a value in the text field is required. This
property can also be defined in the dataElement descriptor. If it is defined
in the model (context or operation context), this value will be the mandatory property
value (the name of this descriptor is isMandatory).
- MinChars: Minimum number of characters required in the text field before
it is formatted. The following data can be customized:
- Minimum length: Minimum number of characters required. If minChars is
greater than maxChars, then minChars will reduce to MaxChars.
- Error Message: The message to be displayed if user input is short.
- navigationParameters: An object that contains properties to facilitate
navigation between views. (For more information about this object see NavigationParameters
object description.) Only the properties that are needed for the specified
type are significant (see the type property, below).
- type: Specifies the type of text field. Possible values are Default, OK,
Clear, Close, Repeat, Euro, EMUCurrency, Help, Previous View, Next View, Undo,
Cancel, Open View, None, and Execute Operation.
- dataDirection: Specifies the direction in which a consistency check is
made between the associated data element and the bean. Following are the possible
values:
- Input: When the combo box is selected, the data element in dataName associated
with the bean is updated.
- Output: When the data element in dataName associated with the bean changes,
the combo box is updated.
- Both: Both the Input and Output behaviors occur.