Skip navigation

Validation

Validation messages in p-tag next to input fields

Switch to tooltip validation

Add SimpleMessageValidation to any markup container and all validation inside container will look like in examples below. Do not use it with TooltipValidation on one page.

This behavior may not work properly with widgets like bootstrap-select or select2. In this case try to wrap all input fields in div (that's done by default in bootstrap form layout) and set appendToParent of config to true.

public MyWebPage(PageParameters parameters) { super(parameters); SimpleMessageValidation validation = new SimpleMessageValidation(); validation.getConfig().appendToParent(true); add(validation); }

Example

Validation for non-ajax forms.

Example

Validation also works with ajax form processing.

Example

Validation in modals.