Skip to main content

Data validation

The validation tag is responsible for performing basic checks regarding mandatory attributes and valid attribute values before being submitted to the persistence handler. The validation tag may contain one or more attribute-validation and script-validation tags. The verification will be performed before running the insert or update handler.

attribute-validator contains the following attributes:



EL expression pointing to the attribute to validate


Text to be presented to the user on validation failure. If there is a ZK label with this text, it will be localized based on current user language preference.


true is the attribute is mandatory
maxLength Maximum length of the attribute
minValue Minimum value in case of numeric attributes
maxValue Maximum value in case of numeric attributes

attribute-script contains a script that will be executed to validate the business object.


<datanode name="country">
        <attribute-validation expr=”${instance.abbrevisation}”
                notNull=”true” friendlyName=”Two letter abbrv.”>
            if (instance.abbreviaton.equals(“CT”))
                throw new RuntimeException (“Catalonia is not a country yet”);