Package io.jmix.flowui.app.inputdialog
Class InputDialog
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.Composite<T>
io.jmix.flowui.view.View<ViewLayout>
io.jmix.flowui.view.StandardView
io.jmix.flowui.app.inputdialog.InputDialog
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier
,com.vaadin.flow.component.DetachNotifier
,com.vaadin.flow.component.HasElement
,com.vaadin.flow.component.HasStyle
,com.vaadin.flow.router.AfterNavigationObserver
,com.vaadin.flow.router.BeforeEnterObserver
,com.vaadin.flow.router.BeforeLeaveObserver
,com.vaadin.flow.router.HasDynamicTitle
,com.vaadin.flow.router.internal.AfterNavigationHandler
,com.vaadin.flow.router.internal.BeforeEnterHandler
,com.vaadin.flow.router.internal.BeforeLeaveHandler
,Serializable
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
Describes result of handler that can be used withDialogAction
in the input dialog.static class
Describes input dialog validation context.Nested classes/interfaces inherited from class io.jmix.flowui.view.View
View.AfterCloseEvent, View.BeforeCloseEvent, View.BeforeShowEvent, View.InitEvent, View.QueryParametersChangeEvent, View.ReadyEvent
-
Field Summary
Modifier and TypeFieldDescriptionprotected com.vaadin.flow.component.orderedlayout.HorizontalLayout
protected Actions
protected DatatypeRegistry
protected DialogActions
protected com.vaadin.flow.component.formlayout.FormLayout
static final CloseAction
ACloseAction
used when the user clicks "CANCEL" button.static final CloseAction
ACloseAction
used when the user clicks "NO" button.static final CloseAction
ACloseAction
used when the user clicks "OK" button and fields validation is successful.static final CloseAction
ACloseAction
used when the user clicks "YES" button and fields validation is successful.protected Messages
protected Metadata
protected String
protected List<InputParameter>
protected List<com.vaadin.flow.component.formlayout.FormLayout.ResponsiveStep>
protected Consumer<InputDialog.InputDialogResult>
protected UiComponents
protected UiComponentsGenerator
protected ViewValidation
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.flow.shared.Registration
addCloseListener
(com.vaadin.flow.component.ComponentEventListener<InputDialog.InputDialogCloseEvent> listener) Adds a close listener to the input dialog.protected DialogAction
createDialogAction
(DialogAction.Type type, CloseAction closeAction) protected com.vaadin.flow.component.Component
createField
(InputParameter parameter) protected void
fillFieldAttributes
(com.vaadin.flow.component.Component field, InputParameter parameter) protected void
fireCloseAndResultEvents
(CloseAction closeAction) Returns predefined dialog actions.com.vaadin.flow.component.formlayout.FormLayout
protected com.vaadin.flow.component.Component
getFormLayoutComponentById
(String parameterId) List<com.vaadin.flow.component.formlayout.FormLayout.ResponsiveStep>
<T> T
Returns value from parameter by its id.Returns values from parameters.protected void
protected void
initActions
(List<Action> actions) protected void
protected void
protected void
protected void
boolean
isValid()
Validates form components and conditions from custom validation supplier and show errors.protected com.vaadin.flow.component.formlayout.FormLayout.ResponsiveStep.LabelsPosition
labelsPositionFromModel
(Dialogs.InputDialogBuilder.LabelsPosition labelsPosition) protected void
onAfterClose
(View.AfterCloseEvent event) protected void
onBeforeShow
(View.BeforeShowEvent event) void
onInit
(View.InitEvent event) void
setActions
(InputDialogAction... actions) Sets dialog actions.void
setDialogActions
(DialogActions actions) Sets predefined dialog actions.void
setLabelsPosition
(Dialogs.InputDialogBuilder.LabelsPosition labelsPosition) Sets labels position for default responsiveSteps.void
setPageTitle
(String pageTitle) void
setParameter
(InputParameter parameter) Add input parameter to the dialog.void
setParameters
(InputParameter... parameters) Sets input parameters.void
setResponsiveSteps
(List<com.vaadin.flow.component.formlayout.FormLayout.ResponsiveStep> responsiveSteps) Sets responsive steps.void
setResultHandler
(Consumer<InputDialog.InputDialogResult> resultHandler) Sets handler for dialog actions (e.g.void
Sets additional handler for field validation.Methods inherited from class io.jmix.flowui.view.StandardView
initContent
Methods inherited from class io.jmix.flowui.view.View
addAfterCloseListener, addBeforeCloseListener, addBeforeShowListener, addInitListener, addQueryParametersChangeListener, addReadyListener, afterNavigation, beforeEnter, beforeLeave, close, close, closeWithDefaultAction, getApplicationContext, getId, getReturnParameters, getViewActions, getViewAttributes, getViewData, getViewFacets, getViewSupport, isPreventBrowserTabClosing, onAttach, onDetach, setApplicationContext, setId, setPreventBrowserTabClosing, setViewActions, setViewData, setViewFacets
Methods inherited from class com.vaadin.flow.component.Composite
getChildren, getContent, getElement
Methods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getEventBus, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setVisible
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListener
Methods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListener
Methods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
-
Field Details
-
INPUT_DIALOG_OK_ACTION
ACloseAction
used when the user clicks "OK" button and fields validation is successful. -
INPUT_DIALOG_CANCEL_ACTION
ACloseAction
used when the user clicks "CANCEL" button. -
INPUT_DIALOG_YES_ACTION
ACloseAction
used when the user clicks "YES" button and fields validation is successful. -
INPUT_DIALOG_NO_ACTION
ACloseAction
used when the user clicks "NO" button. -
parameters
-
actionsList
-
viewValidation
-
uiComponents
-
messages
-
metadata
-
datatypeRegistry
-
actions
-
uiComponentsGenerator
-
formLayout
protected com.vaadin.flow.component.formlayout.FormLayout formLayout -
actionBox
protected com.vaadin.flow.component.orderedlayout.HorizontalLayout actionBox -
responsiveSteps
-
labelsPosition
-
dialogActions
-
idToContentMap
-
resultHandler
-
validator
-
pageTitle
-
-
Constructor Details
-
InputDialog
public InputDialog()
-
-
Method Details
-
onInit
-
initFormLayout
protected void initFormLayout() -
initActionBox
protected void initActionBox() -
onBeforeShow
-
onAfterClose
-
getValue
Returns value from parameter by its id.- Parameters:
parameterId
- parameter id- Returns:
- parameter value
- Throws:
IllegalArgumentException
- exception if wrong parameter id is sent
-
getValues
Returns values from parameters. String - parameter id, Object - parameter value.- Returns:
- values
-
setParameter
Add input parameter to the dialog. Input parameter will be represented as a field.- Parameters:
parameter
- input parameter that will be added to the dialog
-
setParameters
Sets input parameters.- Parameters:
parameters
- input parameters
-
getParameters
- Returns:
- input parameters from dialog
-
setResponsiveSteps
public void setResponsiveSteps(List<com.vaadin.flow.component.formlayout.FormLayout.ResponsiveStep> responsiveSteps) Sets responsive steps. Responsive steps used in describing the responsive layouting behavior of aFormLayout
.- Parameters:
responsiveSteps
- - responsive steps
-
getResponsiveSteps
- Returns:
- responsive steps of FormLayout
-
setLabelsPosition
Sets labels position for default responsiveSteps.- Parameters:
labelsPosition
- position of labels
-
getLabelsPosition
- Returns:
- labels position for default responsiveSteps
-
addCloseListener
public com.vaadin.flow.shared.Registration addCloseListener(com.vaadin.flow.component.ComponentEventListener<InputDialog.InputDialogCloseEvent> listener) Adds a close listener to the input dialog.- Parameters:
listener
- close listener to add- Returns:
- registration
-
setActions
Sets dialog actions. If there is no actions are set input dialog will useDialogActions.OK_CANCEL
.- Parameters:
actions
- actions- See Also:
-
getActions
- Returns:
- actions list
-
setDialogActions
Sets predefined dialog actions. By default, if there is no actions are input dialog will useDialogActions.OK_CANCEL
.- Parameters:
actions
- actions
-
getDialogActions
Returns predefined dialog actions.DialogActions.OK_CANCEL
by default.- Returns:
- dialog actions
-
setResultHandler
Sets handler for dialog actions (e.g. OK, CANCEL, etc) that are used in the dialog. Handler is invoked after close event and can be used instead ofaddCloseListener(ComponentEventListener)
.Note, it is worked only with
setDialogActions(DialogActions)
. Custom actions are not handled.- Parameters:
resultHandler
- result handler
-
getResultHandler
- Returns:
- result handler
-
isValid
public boolean isValid()Validates form components and conditions from custom validation supplier and show errors.- Returns:
- true if validation is successful
-
setValidator
Sets additional handler for field validation. It takes values map and must returnValidationErrors
instance. Returned validation errors will be shown with another errors from fields.- Parameters:
validator
- validator
-
getValidator
- Returns:
- additional field validator
-
initParameters
protected void initParameters() -
fillFieldAttributes
protected void fillFieldAttributes(com.vaadin.flow.component.Component field, InputParameter parameter) -
getFormLayoutComponentById
@Nullable protected com.vaadin.flow.component.Component getFormLayoutComponentById(String parameterId) -
createField
-
initActions
-
initDialogActions
protected void initDialogActions() -
initResponsiveSteps
protected void initResponsiveSteps() -
createDialogAction
-
fireCloseAndResultEvents
-
setPageTitle
-
getPageTitle
- Specified by:
getPageTitle
in interfacecom.vaadin.flow.router.HasDynamicTitle
- Overrides:
getPageTitle
in classView<ViewLayout>
-
getFormLayout
public com.vaadin.flow.component.formlayout.FormLayout getFormLayout() -
labelsPositionFromModel
protected com.vaadin.flow.component.formlayout.FormLayout.ResponsiveStep.LabelsPosition labelsPositionFromModel(Dialogs.InputDialogBuilder.LabelsPosition labelsPosition)
-