Run a custom validator¶
Run application-supplied validation logic that participates in the same error pipeline as property-level errors.
| Field | Value |
|---|---|
| Operation ID | OP-BIND-007 |
| Trigger | Validate() / RefreshValidation() reaching a custom validator |
| Inputs | The validation target object, optionally a key property, and a PropertyValidator or CustomValidator delegate |
| Outputs | Messages appended to ControlErrors; the binder's error flag |
| Primary components | clsObjectBindManager.AddCustomValidator (three overloads), clsCustomValidator.PerformValidation |
| Entry point | SAIF.Presentation.Web.Binding.Infragistics111/clsCustomValidator.vb |
Steps¶
- Reset the error flag.
- Branch on
ValidationType: Property— invoke thePropertyValidationDelegatewith the bind source, the bind property name, and theControlErrorslist so the application appends its own messages (BR-BIND-051).Method— invoke theMethodValidationDelegatewith the validator itself; aFalsereturn sets the error flag (BR-BIND-052).Object— when the bind source is a SAIF framework object, resolve and return itsIsValidproperty value (BR-BIND-053).
Origin: The
Objectbranch delegates to the business object'sIsValidimplementation (clsBusinessBase,SAIF.Framework.Core); the callee's rule-evaluation steps are not visible from this repository.**
- A
Nothingdelegate is a silent no-op. (BR-BIND-054)
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start([Validate reaches custom validator]) --> S1[Reset error flag]
S1 --> D{ValidationType}
D -->|Property| S2[Invoke PropertyValidator delegate]
D -->|Method| S3[Invoke MethodValidator delegate]
D -->|Object| S4[Return bind source IsValid]
S2 --> End([ControlErrors / error flag updated])
S3 --> End
S4 --> End
Failure and edge-case behavior¶
- In the
Propertybranch the delegate populatesControlErrorsdirectly butPerformValidationnever setsm_Errors = True, soContainsErrorstaysFalseand the manager does not surface those messages throughValidate().*
Related documentation¶
Note: Statements marked with * were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts. Statements marked with ** could not be confirmed; treat as unknown until verified. Statements marked with † were retrieved from dependency library documentation via the Legends CLI RAG service.
Sources¶
- SAIF.Presentation.Web.Binding.Infragistics111/clsCustomValidator.vb