Validated input controls |
Top Previous Next |
Overview
Most of the LMD edit controls (including their labeled and/or DB-aware versions) support validation since v. 7.1 of LMD Tools as they implement ILMDValidatedControl interface used by LMD Validators. There is also a demo package LMD Demo VCL Validated controls which includes validated (supporting ILMDValidatedControl interface) versions of most widely used standard VCL controls. Any third-party controls can be enabled to support validation by LMD Validators Package by implementing ILMDValidatedControl interface (see How to create a new validated control topic for details).
Each of validated controls has the Validator property pointing to a Validator component which defines how values entered into this control should be validated. The ValidationMsg property gives control over the feedback message which is typically used by Error Provider component for error indication.
ILMDValidatedControl interface
ILMDValidatedControl interface is to be supported by all the validation-enabled controls. It defines some properties and methods used by Validators and Error Providers components of the validation mechanism. These properties and methods are listed in the tables below.
Properties
Methods (properties getters and setters omitted)
Aspects of introducing ILMDValidatedControl interface support into a control are discussed in the How to Create a new validated control topic.
LMD Demo VCL Validated Controls
A set of Demo VCL Validated Controls is provided as examples of introducing ILMDValidatedControl interface support. This set includes the following controls:
The Grid controls demonstrate some non-typical features of validation support e.g. Validators can be assigned to each of the columns of the gird; mapping of the Validators from the Validators collection property of the grid control is done by the Tag integer property of the TLMDValidatorItem items of the collection (Tag value is interpreted as the number of a column).
List, Label and StatusBar VCL-based controls support ILMDValidatingMsgControl interface and can be used as error messaging controls by TLMDControlErrorProvider.
|