Usage of Edit Masks

This document covers the following topics:


General Information

Natural for Ajax supports a subset of the Natural edit mask concept in order to support output formatting for most of the commonly used fields.

If edit mask support is specified for a field, the field content is

  • rendered according to the edit mask during output, and

  • checked for validity against the edit mask during user input.

Due to the nature of data being handled with a Natural for Ajax client, not all of the different Natural edit mask types make sense. Therefore, only a subset of edit mask types is available for Natural for Ajax.

Data Types with Edit Masks

In all controls that support the property datatype, edit masks can be specified for the data types listed in the topics below:

For detailed information on edit masks, see the Natural documentation for the appropriate platform.

Edit Masks for Numeric Fields

Edit masks for numeric fields can be specified for the following data types:

  • N n.n

  • P n.n

  • int

  • long

  • float

  • xs:double

  • xs:byte

  • xs:short

  • xs:decimal

The full set of Natural numeric edit masks can be applied for these data types.

Edit Masks for Alphanumeric Fields

Edit masks for alphanumeric fields can be specified for the following data type:

  • string n

The full set of Natural alphanumeric edit masks can be applied for this data type.

Edit Masks for Date and Time Fields

Edit masks for date and time fields can be specified for the following data types:

  • date

  • time

  • timestamp (can only be displayed)

  • xs:date

  • xs:time

  • xs:dateTime (can only be displayed)

A subset of the Natural edit masks can be applied for these data types.

Edit masks for date fields may contain the following characters:

Character Usage
DD Day.
ZD Day, with zero suppression.
MM Month.
ZM Month, with zero suppression.
YYYY Year, 4 digits.
YY Year, 2 digits.
Y Year, 1 digit. Must not be used for input fields.

The time in a date/time edit mask may contain the following characters:

Character Usage
T Tenths of a second.
SS Seconds.
ZS Seconds, with zero suppression.
II Minutes.
ZI Minutes, with zero suppression.
HH Hours.
ZH Hours, with zero suppression.

Edit Masks for Logical Fields

Edit masks for logical fields can be specified for the following data types:

  • L

  • xs:boolean

The full set of Natural logical edit masks can be applied for these data types.

Natural Profile Parameters

The following Natural profile parameters are evaluated for the edit mask processing of Natural for Ajax:

  • DC

  • EMFM

For detailed information on these profile parameters, see the Natural documentation for the appropriate platform.

Specifying Edit Masks in Layouts

An edit mask is added to a specific data type in the following way:

Properties

The datatype property of a field is specified (here the numeric type N4.2) and the editmask property is filled with the proper (here numeric) edit mask.

Edit Masks at Runtime

At runtime, fields with edit masks are processed as follows:

  • When a field has an edit mask and when a value is to be displayed in that field, the value is processed and formatted according to the edit mask and is displayed afterwards.

  • When a user enters a value into a field which has an edit mask, the value is validated against that edit mask and the real value is extracted from the entered value by stripping the irrelevant portions of the edit mask.