Convert Mask sub tag

The <hx:convertMask> tag defines how a formatted string is converted to a Java™ value and vice versa. The masked string includes literal characters in defined locations in the string and limits which characters are allowed in other locations in the string.

 

Parent tags

This tag is used as a child of the following tags:

 

Rendering

This component has no visual rendering. No HTML is rendered.

 

Properties and All Attributes views

The Properties view for a component shows the most common set of attributes you can set on a component, and, depending on the component, you might also see options for adding controls, actions, or other components. To open the Properties view, click

Window | Show View | Properties.

These common attributes for the Convert Mask sub tag:

The All Attributes view shows a table of all the attributes you can set on a component, which includes those attributes you can access from the Properties view. To switch to the All Attributes view, click the

All Attributes icon in the upper right corner of the Properties view.

Table 1. Convert Mask attributes

Attribute name

Description

asis

Specifies whether data other than masked inputted are removed or not. Default value is false.

char1RegEx

A regular expression that describes what characters are allowed in positions marked with the # character in the mask pattern. If omitted the expression [0-9] is used (the digits 0 through 9 are allowed).

char2RegEx

A regular expression that describes what characters are allowed in positions marked with the ? character in the mask pattern. If omitted, the expression [a-zA-Z] is used (the ASCII alphabetic characters are allowed).

char3RegEx

A regular expression that describes what characters are allowed in positions marked with the ! character in the mask pattern. If omitted, the ! character is considered a literal in the pattern.

char4RegEx

A regular expression that describes what characters are allowed in positions marked with the ~ character in the mask pattern. If omitted, the ~ character is considered a literal in the pattern.

mask

Describes the pattern of literals and characters for the value.

protectMask

Protects the character in a "marker" position from being changed (or validated), i.e., you can "protect" a position in the string that contains a marker (#,?,!,~) so that a user can't type this character in, instead the value of that position is set programmatically (usually in the initial value). Effectively this turns a character in the value into a literal. This attribute is only useful when the mask is used in an inputText field and that field has input assist enabled on it. If the protectMask is provided, it should be the same length string as the mask. A position is marked as protected if it has an X (an upper-case X) in it. Positions without an X are not protected.