Class ScreenValidation

java.lang.Object
io.jmix.ui.screen.ScreenValidation

@Component("ui_ScreenValidation") public class ScreenValidation extends Object
  • Field Details

    • screenProperties

      @Autowired protected UiScreenProperties screenProperties
    • messages

      @Autowired protected Messages messages
    • icons

      @Autowired protected Icons icons
    • validator

      @Autowired protected javax.validation.Validator validator
  • Constructor Details

    • ScreenValidation

      public ScreenValidation()
  • Method Details

    • validateUiComponents

      public ValidationErrors validateUiComponents(Collection<Component> components)
      Validates UI components by invoking their Validatable.validate().
      Parameters:
      components - components collection
      Returns:
      validation errors
    • validateUiComponents

      public ValidationErrors validateUiComponents(ComponentContainer container)
      Validates UI components by invoking their Validatable.validate().
      Parameters:
      container - components container
      Returns:
      validation errors
    • validate

      protected void validate(Validatable validatable, ValidationErrors errors)
    • showValidationErrors

      public void showValidationErrors(FrameOwner origin, ValidationErrors errors)
      Show validation alert with passed errors and first problem UI component.
      Parameters:
      origin - screen controller
      errors - validation error
    • focusProblemComponent

      protected void focusProblemComponent(ValidationErrors errors)
    • validateCrossFieldRules

      public ValidationErrors validateCrossFieldRules(@Nullable FrameOwner origin, Object item)
      Validate cross-field BeanValidation rules.
      Parameters:
      origin - screen controller
      item - 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 controller
      closeAction - 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 controller
      closeAction - close action
      Returns:
      result