How to Add a Masked Text Field
Overview
This section explains how to add a masked text field and column to the Etendo system. A masked text can be used to force the user in entering text/string values in the correct format.
The steps to get a masked text field in the window consists of the following steps:
- create a reference defining the mask.
- add a column to a table using the reference.
- add a field to a tab.
The last 2 steps are defined in detail in the following sections:
This section will only focus on the specific parts of a masked text field.
Example Module
This section is supported by an example module which shows example of the code shown and discussed in this section.
The example module adds a mask text field to the sales order header window.
The code of the example module can be downloaded from this mercurial repository: https://github.com/etendosoftware/com.etendoerp.client.application.examples
Defining the Mask Reference
The first step is to create a specific reference for the mask and then set the mask in the mask reference child tab.
The mask reference must have the Masked String as the parent reference and can not be a base reference. Then create a record in the Mask Reference child tab defining the mask.
Info
For information on how to define a mask see the description in the Masked String parent reference.

Adding a column
To get a mask text field, the first thing to do is to select the correct reference and reference search key when adding a column:
Create a field
Then, create a field within the tab/window:
The result
The result is visualized as a masked text editor in form view:
This work is a derivative of How to Add a Masked Text Field by Openbravo Wiki, used under CC BY-SA 2.5 ES. This work is licensed under CC BY-SA 2.5 by Etendo.



