@Component(value="ui_ScreenValidation")
public class ScreenValidation
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
ScreenValidation.SaveChangesDialogResult
Callbacks holder for save changes dialog.
|
static class |
ScreenValidation.UnsavedChangesDialogResult
Callbacks holder for unsaved changes dialog.
|
Modifier and Type | Field and Description |
---|---|
protected Icons |
icons |
protected io.jmix.core.Messages |
messages |
protected UiScreenProperties |
screenProperties |
protected javax.validation.Validator |
validator |
Constructor and Description |
---|
ScreenValidation() |
Modifier and Type | Method and Description |
---|---|
protected void |
focusProblemComponent(ValidationErrors errors) |
ScreenValidation.SaveChangesDialogResult |
showSaveConfirmationDialog(FrameOwner origin,
CloseAction closeAction)
Shows standard save confirmation dialog with Save, Discard and Cancel actions.
|
ScreenValidation.UnsavedChangesDialogResult |
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) |
ValidationErrors |
validateCrossFieldRules(FrameOwner origin,
java.lang.Object item)
Validate cross-field BeanValidation rules.
|
ValidationErrors |
validateUiComponents(java.util.Collection<Component> components)
Validates UI components by invoking their
Validatable.validate() . |
ValidationErrors |
validateUiComponents(ComponentContainer container)
Validates UI components by invoking their
Validatable.validate() . |
@Autowired protected UiScreenProperties screenProperties
@Autowired protected io.jmix.core.Messages messages
@Autowired protected Icons icons
@Autowired protected javax.validation.Validator validator
public ValidationErrors validateUiComponents(java.util.Collection<Component> components)
Validatable.validate()
.components
- components collectionpublic ValidationErrors validateUiComponents(ComponentContainer container)
Validatable.validate()
.container
- components containerprotected void validate(Validatable validatable, ValidationErrors errors)
public void showValidationErrors(FrameOwner origin, ValidationErrors errors)
origin
- screen controllererrors
- validation errorprotected void focusProblemComponent(ValidationErrors errors)
public ValidationErrors validateCrossFieldRules(@Nullable FrameOwner origin, java.lang.Object item)
origin
- screen controlleritem
- item to validatepublic ScreenValidation.UnsavedChangesDialogResult showUnsavedChangesDialog(FrameOwner origin, CloseAction closeAction)
origin
- screen controllercloseAction
- close actionpublic ScreenValidation.SaveChangesDialogResult showSaveConfirmationDialog(FrameOwner origin, CloseAction closeAction)
origin
- screen controllercloseAction
- close action