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,FragmentOwner,Serializable
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classDescribes result of handler that can be used withDialogActionin the input dialog.static classDescribes 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
FieldsModifier and TypeFieldDescriptionprotected com.vaadin.flow.component.orderedlayout.HorizontalLayoutprotected Actionsprotected DatatypeRegistryprotected DialogActionsprotected com.vaadin.flow.component.formlayout.FormLayoutstatic final CloseActionACloseActionused when the user clicks "CANCEL" button.static final CloseActionACloseActionused when the user clicks "NO" button.static final CloseActionACloseActionused when the user clicks "OK" button and fields validation is successful.static final CloseActionACloseActionused when the user clicks "YES" button and fields validation is successful.protected Messagesprotected Metadataprotected Stringprotected List<InputParameter>protected List<com.vaadin.flow.component.formlayout.FormLayout.ResponsiveStep>protected Consumer<InputDialog.InputDialogResult>protected UiComponentsprotected UiComponentsGeneratorprotected ViewValidation -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.flow.shared.RegistrationaddCloseListener(com.vaadin.flow.component.ComponentEventListener<InputDialog.InputDialogCloseEvent> listener) Adds a close listener to the input dialog.protected DialogActioncreateDialogAction(DialogAction.Type type, CloseAction closeAction) protected com.vaadin.flow.component.ComponentcreateField(InputParameter parameter) protected voidfillFieldAttributes(com.vaadin.flow.component.Component field, InputParameter parameter) protected voidfireCloseAndResultEvents(CloseAction closeAction) Returns predefined dialog actions.com.vaadin.flow.component.formlayout.FormLayoutprotected com.vaadin.flow.component.ComponentgetFormLayoutComponentById(String parameterId) List<com.vaadin.flow.component.formlayout.FormLayout.ResponsiveStep><T> TReturns value from parameter by its id.Returns values from parameters.protected voidprotected voidinitActions(List<Action> actions) protected voidprotected voidprotected voidprotected voidprotected voidbooleanisValid()Validates form components and conditions from custom validation supplier and show errors.protected com.vaadin.flow.component.formlayout.FormLayout.ResponsiveStep.LabelsPositionlabelsPositionFromModel(Dialogs.InputDialogBuilder.LabelsPosition labelsPosition) protected voidonAfterClose(View.AfterCloseEvent event) protected voidonBeforeShow(View.BeforeShowEvent event) voidonInit(View.InitEvent event) voidsetActions(InputDialogAction... actions) Sets dialog actions.voidsetDialogActions(DialogActions actions) Sets predefined dialog actions.voidsetLabelsPosition(Dialogs.InputDialogBuilder.LabelsPosition labelsPosition) Sets labels position for default responsiveSteps.voidsetPageTitle(String pageTitle) voidsetParameter(InputParameter parameter) Add input parameter to the dialog.voidsetParameters(InputParameter... parameters) Sets input parameters.voidsetResponsiveSteps(List<com.vaadin.flow.component.formlayout.FormLayout.ResponsiveStep> responsiveSteps) Sets responsive steps.voidsetResultHandler(Consumer<InputDialog.InputDialogResult> resultHandler) Sets handler for dialog actions (e.g.voidSets additional handler for field validation.Methods inherited from class io.jmix.flowui.view.StandardView
initContentMethods 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, onDetachInternal, removeApplicationListeners, removeViewAttributes, setAfterNavigationHandler, setApplicationContext, setId, setMeterRegistry, setPreventBrowserTabClosing, setViewActions, setViewData, setViewFacets, unregisterBackNavigationMethods inherited from class com.vaadin.flow.component.Composite
getChildren, getContent, getElementMethods 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, setVisibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
-
Field Details
-
INPUT_DIALOG_OK_ACTION
ACloseActionused when the user clicks "OK" button and fields validation is successful. -
INPUT_DIALOG_CANCEL_ACTION
ACloseActionused when the user clicks "CANCEL" button. -
INPUT_DIALOG_YES_ACTION
ACloseActionused when the user clicks "YES" button and fields validation is successful. -
INPUT_DIALOG_NO_ACTION
ACloseActionused 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
-
initFocusComponent
protected void initFocusComponent() -
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_CANCELby 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 returnValidationErrorsinstance. 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:
getPageTitlein interfacecom.vaadin.flow.router.HasDynamicTitle- Overrides:
getPageTitlein 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)
-