Changing validation logic

You can include client-side validation logic for the Management Center. Create validation rules for information that users provide using the user interface. For example, validate that users have entered text, not numbers; that a start date is not later than an end date; or that a mandatory field is not empty).

About this task

The Management Center includes two types of client-side validation: at the object level, and at the object property level. There are a number of existing validators (see the classes that extend from lzx/commerce/foundation/restricted/Validator.lzx/wcfValidator). You can also implicitly declare validation rules by using the following attributes of lzx/commerce/foundation/restricted/PropertyDefinition.lzx/wcfPropertyDefinition: maxValue, maximumSize, minValue, required, and type. If the existing validators, or the implicit validators, do not meet your needs, you can write a custom validator.

When an object is modified on the client, client-side validation is invoked and if errors are found, the validator adds the error to the object or to a specific object property. The error messages reported by the validator are displayed in the properties view and if the message is scoped to a specific property, the widgets that display that property are given a visual treatment to indicate that the property is in error. When the widget is given focus, any associated error messages are displayed. Client-side messages are also logged in the Management Center message console.