Package io.jmix.flowui.view
Class ViewValidation
java.lang.Object
io.jmix.flowui.view.ViewValidation
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classCallbacks holder for saving or discarding unsaved changes dialog.static classCallbacks holder for discarding unsaved changes dialog.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected Dialogsprotected Messagesprotected Notificationsprotected jakarta.validation.Validatorprotected UiViewProperties
- 
Constructor SummaryConstructorsConstructorDescriptionViewValidation(Messages messages, jakarta.validation.Validator validator, Dialogs dialogs, UiViewProperties viewProperties, Notifications notifications) 
- 
Method SummaryModifier and TypeMethodDescriptionprotected Collection<ValidationErrors.Item>collectValidationErrorItems(ValidationException e, com.vaadin.flow.component.Component component) voidFocuses a component corresponding to the first validation error, if there is one.static StringCreates a message explaining the given validation errors.showSaveConfirmationDialog(View<?> origin) Shows confirmation dialog about saving or discarding unsaved changes.showUnsavedChangesDialog(View<?> origin) Shows confirmation dialog about discarding unsaved changes.voidshowValidationErrors(ValidationErrors errors) Shows a notification with validation errors.protected voidshowValidationErrorsNotification(ValidationErrors errors, int duration, com.vaadin.flow.component.notification.Notification.Position position, Notifications.Type type) protected Collection<ValidationErrors.Item>validate(SupportsValidation<?> component) validateBeanGroup(Class<?> groupClass, Object item) Performs Java Bean Validation of the given object.validateUiComponent(com.vaadin.flow.component.Component component) Validates UI component by invoking theirSupportsValidation.executeValidators().validateUiComponents(com.vaadin.flow.component.Component container) Validates UI components located inside the given container by invoking theirSupportsValidation.executeValidators().validateUiComponents(Collection<com.vaadin.flow.component.Component> components) Validates UI components by invoking theirSupportsValidation.executeValidators().
- 
Field Details- 
messages
- 
validatorprotected jakarta.validation.Validator validator
- 
dialogs
- 
notifications
- 
viewProperties
 
- 
- 
Constructor Details- 
ViewValidation@Autowired public ViewValidation(Messages messages, jakarta.validation.Validator validator, Dialogs dialogs, UiViewProperties viewProperties, Notifications notifications) 
 
- 
- 
Method Details- 
validateUiComponentsValidates UI components located inside the given container by invoking theirSupportsValidation.executeValidators().- Parameters:
- container- a component that can contain other components
- Returns:
- validation errors
 
- 
validateUiComponentspublic ValidationErrors validateUiComponents(Collection<com.vaadin.flow.component.Component> components) Validates UI components by invoking theirSupportsValidation.executeValidators().- Parameters:
- components- components collection
- Returns:
- validation errors
 
- 
validateUiComponentValidates UI component by invoking theirSupportsValidation.executeValidators().- Parameters:
- component- UI component
- Returns:
- validation errors
 
- 
validateBeanGroupPerforms Java Bean Validation of the given object.- Parameters:
- groupClass- the group or list of groups targeted for validation
- item- object to validate
- Returns:
- validation errors
 
- 
showValidationErrorsShows a notification with validation errors.- Parameters:
- errors- validation errors
 
- 
showValidationErrorsNotificationprotected void showValidationErrorsNotification(ValidationErrors errors, int duration, com.vaadin.flow.component.notification.Notification.Position position, Notifications.Type type) 
- 
focusProblemComponentFocuses a component corresponding to the first validation error, if there is one.- Parameters:
- errors- validation errors
 
- 
getValidationErrorsMessageCreates a message explaining the given validation errors.- Parameters:
- errors- validation errors
- Returns:
- error messsage
 
- 
validate
- 
collectValidationErrorItemsprotected Collection<ValidationErrors.Item> collectValidationErrorItems(ValidationException e, com.vaadin.flow.component.Component component) 
- 
showUnsavedChangesDialogShows confirmation dialog about discarding unsaved changes.The options invoke the callback methods of the returned ViewValidation.UnsavedChangesDialogResultobject.- Parameters:
- origin- view controller
- Returns:
- object that contains "discard" and "cancel" callbacks to be assigned by the caller.
 
- 
showSaveConfirmationDialogShows confirmation dialog about saving or discarding unsaved changes.The options invoke the callback methods of the returned ViewValidation.SaveChangesDialogResultobject.- Parameters:
- origin- view controller
- Returns:
- object that contains "save", "discard" and "cancel" callbacks to be assigned by the caller.
 
 
-