Text, date, and numeric fields can use masks and patterns
to format or parse field values. You can use edit masks and display
patterns to override the styles or patterns that are defined in
the data model.
In the Guide Properties view for a field, you can select an edit
mask or a display format:
- Edit mask
- Describes the syntax for entering data into a field. The
edit mask applies when the focus is placed on the field.
- Display format
- Describes how data is displayed in the Guide. It formats
user input and any bound values retrieved at runtime.
Fields can use both an edit mask and a display format. The edit
mask applies when focus is on the field and the Guide filler is
entering data in the field. The display format applies when focus
leaves the field.
You can select a predefined Edit Mask or Display Format. Alternatively,
define your own mask in the data model (FML) or in the XDP form.
The field inherits any mask defined in the model.
Patterns in XDP forms
In addition to edit
masks and display formats, XDP forms can define the following patterns:
- Validation pattern
- Validates user input at runtime.
- Data pattern
- Describes the syntax of bound or saved data.
For
more information about defining patterns in XDP forms, see the Designer Help.
Note: In Guides
based on XDP forms, you cannot set a Display Format for Date Fields.
Masks and Control Type properties
When
you add an item from the Data Model view to a Guide, you set the
Control Type properties in the Guide Properties view. The data type
and masks that are specified in the data model determine the Control
Type properties:
When both an edit and a display
mask are specified, and they are different, the Display As property
is Text Input.
When both an edit and a display mask are specified, and they
are the same, the Display As property is Text Input Mask or Text
Input.
When only an edit mask is specified, the Display As property
defaults to Text Input Mask or Text Input.
When either no mask or only a display mask is specified,
the Display As property depends on the data type:
If the data type is date, the Display As property is Date
Field. The mask uses a month name (MMM D YYYY).
Note: In LiveCycle
Workbench 9, Date Fields used a numeric display, such as 8/31/10.
In LiveCycle - Workbench, Date Fields use a month name, such as
Aug 13, 2011.
For other data types, the Display As property is Text Input
Mask or Text Input.
To create a phone
number field in an data model (FML), use a text property with numeric
edit and display masks. To create a phone number field in an XDP
form that follows the North American format, use a Text object,
and use the pattern 999-999-9999.
Patterns in data models (FML)
In Guides
based on an data model (FML), Date Fields can specify a Display
Format. Date Fields can specify an Edit Mask only if one was specified
in the data model (FML).
Guides based on an data model (FML)
cannot validate against a Japanese date pattern that contains long or full month
patterns. The default date pattern that is used when no style is
defined is MMM D YYYY. The only patterns that work for date fields
when rendered on a Japanese operating system are short patterns, such
as DD/MM/YYYY.
Currency symbols
When you define a mask
with a currency symbol, the currency symbol is not converted to
the locale that accesses the Guide. For example, if you define a
mask as $z,zz9.99, it is not converted to €z,zz9 on a European operating
system or to ¥z,zz9.99 on a Japanese operating system.
To
use a currency symbol other than the dollar sign ($), use either
a mask in the data model or the Control Type properties in Workbench:
To use a mask in the data model, specify the currency symbol
in the mask as a literal. For example, use '€' z,zz9.99 or '¥' z,zz9.99.
To use the Control Type properties in Workbench, select the
field and then set the properties in the Guide Properties view:
From the Display As property, select Text Input Symbol.
In the Prefix Symbol property, type the currency symbol,
such as € or ¥.