Version 8.3.4
 —  Development Workplace  —

Using the Validation Rules Editor

The Validation Rules Editor is part of the Layout Painter. You can use it to define that the value that is entered in a field must meet certain conditions. You can test your validation rule in the preview area. If an invalid value is entered, a corresponding message appears. Example:

Message

Important:
The validation is done on the client side.

The following topics are covered:


Opening the Validation Rules Editor

When you open the Validation Rules Editor, you can add, modify and remove validation rules.

Start of instruction setTo open the Validation Rules Editor

  1. In the layout tree, select the field control that you want to validate.

    Or:
    Select the field control in the HTML preview.

  2. From the Tools tab of the Layout Painter, choose Validation Rules.

    A dialog appears. If validation rules have already been defined, the messages that have been defined for these rules are shown in the text box. Example:

    Validation Rules Editor

    The following command buttons are provided:

    Command Button Description
    Add Adds a new validation rule. See below.
    Modify Modifies the selected validation rule.
    Remove Removes the selected validation rule.

Top of page

Adding a New Validation Rule

The prerequisite for adding a validation rule for a field is that an adapter class with the corresponding code exists for the field. Otherwise, the field does not appear in the Validation Rules Editor.

You can add more than one validation rule.

Start of instruction setTo add a new validation rule

  1. To add a validation rule, choose the Add button.

    Additional information is now shown at the bottom of the dialog.

    Validation Rules Editor

  2. From the first drop-down list box, select the name of the field for which you want to add a condition.

  3. From the second drop-down list box, select the condition (for example, "less than").

  4. In the third drop-down list box, enter the value for the condition (for example, "100").

  5. Optional. From the fourth drop-down list box, select the operator And or Or if you want to define an additional condition. In this case, you have to choose the Add button which is shown in the lower part of the dialog and specify the required values in the resulting line (as described above).

  6. In the Message text box, enter the message that is to appear in a dialog box when an invalid value is entered (for example: "The value in the field must not be less than 100!").

    Or:
    If you are working with several languages, enter a text ID in the Text ID text box. See Multi Language Management for further information.

  7. From the Events drop-down list box, select one of the following values. This defines the behavior in the case of an error.

    Event Description
    onchange Your message will appear when the user leaves the input field.
    onsubmit Your message will appear when the information is about to be transferred to the server (for example, by choosing a Save button).

    The lower part of the dialog may now look as follows:

    Validation Rules Editor

  8. Optional. If you want to delete a condition, select the corresponding row and choose the Delete button.

  9. To confirm the new validation rule, choose the OK button in the lower part of the window.

    The window is not closed and you can add further validation rules.

  10. To confirm all validation rules and to close the window, choose the OK button in the upper part of the window.

Top of page

Displaying an Overview of All Defined Validation Rules

You can display a list of all validation rules which are defined in the current layout.

Start of instruction setTo display an overview

Top of page