Skip navigation

Validation

Validation messages in p-tag next to input fields

Switch to tooltip validation

How to use

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(); add(validation); }

Validation

Example

Validation for non-ajax forms.

Validation for ajax forms

Example

Validation also works with ajax form processing.

Validation in modals

Example

Validation in modals.