Home Documentation Download License Contact

Node Validation

Validates data of M4.EmployModel.EmployRow typically on events like ValueChanging or ValueChanged of one or more fields of that row.
Allows you to aborts data changes or add an ValidationResult to one or more fields. The "Tree Employ Component" displays messages of validation results and adhere validation result properties not to save, close or delete a record.

NOTE: Node validations are intended to use, if the validation affects several employ fields. Nevertheless you might want to choose a field validation instead. This is always possible, even if several fields are affected. Employ fields are attached to their parent employ row, giving access to all fields of that row.

Key NodeValidation
Defined In M4.ApplicationModel.AccessNode
Multiple node validations can be defined. Implementation is optional.
Interface M4.ApplicationModel.INodeValidation

EmployRow M4.EmployModel.EmployRow
Is set on validation before Validate() method is called.

Validate()
Is called once after row data is read or new row is created. Add here handler for row or field events to apply validations on data changes.

NOTE: You can also inherit from M4.ApplicationModel.NodeValidation.
This abstract class implements M4.ApplicationModel.INodeValidation with implementation of EmployRow.
Standard Implementations Compare Field1 with Field2 - M4.ApplicationModel.CompareFieldsValidation
Checks if field 1 is smaller than or optional equal with field 2. Has properties to define the keys of field 1 and 2 and the option to allow equal values. Validation allows to define a validation messages for each field and to set a flag to deny saving, if validation failed.
Example M4CustomLibrary.Validations.BothOrNoneIsNullValidation
Checks for two fields if only one of the fields has an empty value. Shows validation message for empty field.
Has properties to define the keys of field 1 and 2. Validation allows to define validation messages for each field and to set a flag to deny saving, if validation failed.