Edit Masks

In our applications we always need to add masks to some field on the form.
RadCORE brings an attribute to reduce this codification.
Let's take as an example "frmDEMO_FORMS".
- DATE
- PHONE
- ID
Observe the "HINT" property of each component mentioned above (respectively):
[mask:date]] : Applies mask to dates
[mask:phone]] : Apply mask for phone( Default Brazilian )
[[mask:99.99]] : Apply custom mask
There are other masks and of course there are differences between countries. You can study the content of the functions involved and create your own masks.
IMPORTANT:
When used with DBWARE components (UniDBEdit for example), the associated field (DATAFIELD) must have its size summed by the characters of the mask.
Ex: a phone number with (85)9877-0123 will save "8598770123", which has 10 digits, but the field in the database table must have 13 digits. The mask will not be saved, but this configuration is necessary for it to work.
Mask Conditional on the contents of a field
In the register of clients we have an example of conditional masking in the field "edCnpjCpf".
Here in Brazil, we have 2 documents: CPF( for people ) and CNPJ( for companies ).
Open the "frmCadCLIENTS" and search for "dm_rc.rc_MaskAdjust". Study all the points where I applied the function to understand how to proceed for a similar need in your application.
Rendering the masks
The function "dm_rc.rc_ApplyEditMasks( Self );" is responsible for rendering components that have "mask:" attributes and must be called in the "...ready" event of the frame / form:

or in some dynamically changing situation as in the example below:

Created with the Personal Edition of HelpNDoc: Produce electronic books easily