A collection of Validation Errors that let you indicate errors that occured during calls to the Validate() method or otherwise.
Each Validation error is an instance of wwValidationError object which has the following structure:
Optional - The name of the control that the error occurred on. This flag is used to allow the Page handler to automatically pick up the control and allow assigning of validation messages next to the control.
The best way to create ValidationErrors is to use the AddValidationError() method of this class.
The Validation Error Collection can be added the wwWebPage.BindingErrors Collection using the wwWebPage::AddValidationErrorsToBindingErrors() method which allows displaying both validation and binding error messages in a single error display.
LOCAL loDev loDev = THIS.oData this.cErrorMsg = "" this.oValidationerrors.Clear() IF EMPTY(loDev.Company) this.AddValidationerror("A company name is required.","txtCompany") ENDIF IF EMPTY(loDev.Name) this.AddValidationError("A contact name is required.","txtName") ENDIF IF LEN(loDev.Services) < 200 this.AddValidationError("The service description is too short. At least 200 characters are required.","txtServices") ENDIF IF this.oValidationErrors.Count > 0 THIS.SetError(this.oValidationErrors.ToString()) RETURN .F. ENDIF RETURN .T.
See also:Class wwBusinessObject | wwBusinessObject::AddValidationError |
Comment or report problem with topic