Package io.jmix.ui.screen
Class ScreenValidation
java.lang.Object
io.jmix.ui.screen.ScreenValidation
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Callbacks holder for save changes dialog.static class
Callbacks holder for unsaved changes dialog. -
Field Summary
Modifier and TypeFieldDescriptionprotected Icons
protected Messages
protected ScreenListComponentValidation
protected UiScreenProperties
protected javax.validation.Validator
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
showSaveConfirmationDialog
(FrameOwner origin, CloseAction closeAction) Shows standard save confirmation dialog with Save, Discard and Cancel actions.showUnsavedChangesDialog
(FrameOwner origin, CloseAction closeAction) Shows standard unsaved changes dialog with Discard and Cancel actions.void
showValidationErrors
(FrameOwner origin, ValidationErrors errors) Show validation alert with passed errors and first problem UI component.protected void
validate
(Validatable validatable, ValidationErrors errors) validateCrossFieldRules
(FrameOwner origin, Object item) Validate cross-field BeanValidation rules.validateUiComponents
(ComponentContainer container) Validates UI components by invoking theirValidatable.validate()
.validateUiComponents
(Collection<Component> components) Validates UI components by invoking theirValidatable.validate()
.validateUiListComponents
(ComponentContainer container) Validate UI List components by performing validation of underlying entity instances and its collection properties if those components are able to modify their collections within source screen (due to visibility, standard actions etc).
-
Field Details
-
screenProperties
-
messages
-
icons
-
validator
@Autowired protected javax.validation.Validator validator -
screenListComponentValidation
-
-
Constructor Details
-
ScreenValidation
public ScreenValidation()
-
-
Method Details
-
validateUiComponents
Validates UI components by invoking theirValidatable.validate()
.- Parameters:
components
- components collection- Returns:
- validation errors
-
validateUiComponents
Validates UI components by invoking theirValidatable.validate()
.- Parameters:
container
- components container- Returns:
- validation errors
-
validateUiListComponents
Validate UI List components by performing validation of underlying entity instances and its collection properties if those components are able to modify their collections within source screen (due to visibility, standard actions etc).- Parameters:
container
- components container- Returns:
- validation errors
-
validate
-
showValidationErrors
Show validation alert with passed errors and first problem UI component.- Parameters:
origin
- screen controllererrors
- validation error
-
focusProblemComponent
-
validateCrossFieldRules
Validate cross-field BeanValidation rules.- Parameters:
origin
- screen controlleritem
- item to validate- Returns:
- validation errors
-
showUnsavedChangesDialog
public ScreenValidation.UnsavedChangesDialogResult showUnsavedChangesDialog(FrameOwner origin, CloseAction closeAction) Shows standard unsaved changes dialog with Discard and Cancel actions.- Parameters:
origin
- screen controllercloseAction
- close action- Returns:
- result
-
showSaveConfirmationDialog
public ScreenValidation.SaveChangesDialogResult showSaveConfirmationDialog(FrameOwner origin, CloseAction closeAction) Shows standard save confirmation dialog with Save, Discard and Cancel actions.- Parameters:
origin
- screen controllercloseAction
- close action- Returns:
- result
-