EditMask property editor

To display this property editor, choose the editMask property from the Inspector when any (StorageDataSet) Column component is selected in the Component Tree.

The editMask property stores the string specification used to format and control the entry of data in the column when the user starts editing data. Before editing starts, the displayMask handles the formatting and parsing. Edit masks affect the formatting of data by displaying spaces or special characters that ease data entry. For String columns, these characters may optionally be stored with the data or not. For example, displaying parenthesis for a telephone number can ease data entry by clearly separating the area code from the telephone number.

Edit masks also restrict the type of data the user can enter, for example, by allowing digits only, or requiring entry in certain parts of a field, and so on.

User-defined edit masks are not altered if the column's locale changes.

When entering data into an edit mask and using the left shift feature where characters are entered from the right end of the pattern specification and shift left, if any character input cannot shift left, shifting stops. If you continue to type when you are positioned at the right of the pattern, the last character is overwritten with each key pressed.

Edit and display masks are never substituted one for the other if one is supplied and the other not. However, if an edit mask is not specified, the display mask performs validation of user input.

If you find that the editMask does not handle your formatting needs, you can create your own class which implements the ItemEditMask interface and assign it into the Column component's editMasker property directly. In such cases, do not assign the editMask property as your editMasker will be overwritten.

To reset a display mask back to its default, call the setDisplayMask() method.

For examples of patterns used with display masks, see Adding an Edit or Display Pattern to control data in the Database Application Developer's Guide.

See also: displayMask property, String-based patterns (masks)

Mask

Enter a valid pattern, or mask, or select one from the list of sample masks. See Sample Masks for references to resources that provide more sample masks.

Description

Provide a verbal description of the type of information that would use the pattern you just entered. This is not required, but if you add the pattern to the Sample Masks list, the description will make it easier to use in future applications.

Add to Samples button

Click this button to add the mask and description currently in the Mask and Description field to the list of Sample Masks.

Test Input

Double-click in this field to enter sample data into this field in the format specified in the Mask field.

Test button

Click this button to verify that the sample data and the Mask are compatible.

Sample Masks

Provides some examples of masks available for the type of data selected. For more sample masks, see String-based patterns (masks) or Adding an Edit or Display Pattern for data formatting. Each of these topics discusses masks for numeric data patterns, date and time data patterns, text data patterns, and boolean data patterns.