Package io.jmix.flowui.view
Class StandardDetailView<T>
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.view.StandardDetailView<T>
- Type Parameters:
- T- entity class
- 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,- ChangeTracker,- DetailView<T>,- ReadOnlyAwareView,- Serializable
- Direct Known Subclasses:
- AdditionalBusinessDayDetailView,- AssignmentDetailsPropertiesFragment,- BusinessCalendarDetailView,- CandidateGroupsEditView,- CandidateUsersEditView,- CategoryAttributesDetailView,- CategoryDetailView,- ContentStorageDetailView,- DmnDecisionTableDetailView,- EmailAttachmentEdit,- EntityAttributeEdit,- EntityAttributeResourcePolicyModelDetailView,- EntityInspectorDetailView,- EntityResourcePolicyModelDetailView,- ErrorDefinitionEdit,- ErrorRefPropertiesFragment,- EventListenerEdit,- ExecutionListenerEdit,- ExtensionPropertyEdit,- FieldEdit,- FilterConditionDetailView,- FormFieldEdit,- FormOutcomeEdit,- FormParamEdit,- GraphQLResourcePolicyModelDetailView,- HitPolicySelectView,- HolidayDetailView,- InAppNotificationDetailView,- InOutBindingModelEdit,- InputDefinitionDetailView,- InputEntryDetailView,- JobDataDetailView,- JobModelDetailView,- JpqlParameterEdit,- MBeanAttributeDetailView,- MBeanInfoDetailView,- MenuResourcePolicyModelDetailView,- MessageDefinitionEdit,- MultiInstanceLoopCharacteristicsPropertiesFragment,- OutputDefinitionDetailView,- ProcessDefinitionDetailView,- ProcessInstanceDetailView,- ProcessVariableEdit,- QueryParameterDetailView,- ReportDetailView,- ReportGroupDetailView,- ReportParameterDetailView,- ReportRegionWizardDetailView,- ReportTemplateDetailView,- ReportValueFormatDetailView,- ResourcePolicyModelDetailView,- ResourceRoleModelDetailView,- RowLevelPolicyModelDetailView,- RowLevelRoleModelDetailView,- ScheduledBusinessDayDetailView,- ScriptEditor,- SignalDefinitionEdit,- SpecificResourcePolicyModelDetailView,- TaskListenerEdit,- TenantDetailView,- TriggerModelDetailView,- UiComponentResourcePolicyModelDetailView,- UserGroupDetailView,- UserSubstitutionDetailView,- VariableInstanceDataDetail,- ViewResourcePolicyModelDetailView,- WebdavDocumentCollectionDetailView,- WebdavShowDocumentVersionsDetailView
Base class of entity detail views.
- See Also:
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classEvent sent after saving the view data context.static classEvent sent before saving the view data context.static classEvent sent before the new entity instance is set to edited entity container.static classEvent sent when the view requests an external lock, if one is defined.static classEvent sent when the view is validated on saving the view data context.Nested classes/interfaces inherited from class io.jmix.flowui.view.ViewView.AfterCloseEvent, View.BeforeCloseEvent, View.BeforeShowEvent, View.InitEvent, View.QueryParametersChangeEvent, View.ReadyEvent
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected com.vaadin.flow.shared.RegistrationaddAfterSaveListener(com.vaadin.flow.component.ComponentEventListener<StandardDetailView.AfterSaveEvent> listener) Adds a listener toStandardDetailView.AfterSaveEvent.protected com.vaadin.flow.shared.RegistrationaddBeforeSaveListener(com.vaadin.flow.component.ComponentEventListener<StandardDetailView.BeforeSaveEvent> listener) Adds a listener toStandardDetailView.BeforeSaveEvent.protected com.vaadin.flow.shared.RegistrationaddInitEntityListener(com.vaadin.flow.component.ComponentEventListener<StandardDetailView.InitEntityEvent<T>> listener) Adds a listener toStandardDetailView.InitEntityEvent.protected com.vaadin.flow.shared.RegistrationaddValidationEventListener(com.vaadin.flow.component.ComponentEventListener<StandardDetailView.ValidationEvent> listener) Adds a listener toStandardDetailView.ValidationEvent.voidbeforeEnter(com.vaadin.flow.router.BeforeEnterEvent event) Discards changes and closes the view.Saves changes and closes the view.protected voidfindEntityId(com.vaadin.flow.router.BeforeEnterEvent event) protected InstanceContainer<T>protected InstanceLoader<T>protected Stringprotected Stringbooleanprotected voidinitExistingEntity(String serializedEntityId) protected voidinitNewEntity(Class<T> entityClass) booleanbooleanprotected booleanbooleanprotected booleanbooleanbooleanprotected voidsave()Saves changes.voidsetCrossFieldValidationEnabled(boolean crossFieldValidationEnabled) Sets whether cross-field validation should be performed before saving changes.voidsetEntityToEdit(T entity) Sets entity instance to the view.voidsetReadOnly(boolean readOnly) Changes the read-only mode.protected voidsetReloadEdited(boolean reloadEdited) Sets whether the edited entity should be reloaded before setting to the data container.voidsetReloadSaved(boolean reloadSaved) Sets whether edited entity should be reloaded after closeWithSave action.voidsetShowSaveNotification(boolean showSaveNotification) Sets whether a notification should be shown in case of successful save.voidsetShowValidationErrors(boolean showValidationErrors) Sets whether to indicate about errors after components validation.protected voidInvoked onView.BeforeShowEventboth when the view is opened by navigation and in dialog window.protected voidsetupEntityToEdit(String serializedEntityId) Invoked when the view is opened by navigation.protected voidsetupEntityToEdit(T entityToEdit) Invoked when the view is opened in dialog window or when the view is opened by navigation andsetEntityToEdit(Object)method is called inAfterViewNavigationEventhandler.protected ValidationErrorsMethods inherited from class io.jmix.flowui.view.StandardViewinitContentMethods inherited from class io.jmix.flowui.view.ViewaddAfterCloseListener, addBeforeCloseListener, addBeforeShowListener, addInitListener, addQueryParametersChangeListener, addReadyListener, afterNavigation, beforeLeave, close, close, closeWithDefaultAction, getApplicationContext, getId, getPageTitle, getReturnParameters, getViewActions, getViewAttributes, getViewData, getViewFacets, getViewSupport, isPreventBrowserTabClosing, onAttach, onDetach, removeApplicationListeners, removeViewAttributes, setAfterNavigationHandler, setApplicationContext, setId, setMeterRegistry, setPreventBrowserTabClosing, setViewActions, setViewData, setViewFacets, unregisterBackNavigationMethods inherited from class com.vaadin.flow.component.CompositegetChildren, getContent, getElementMethods inherited from class com.vaadin.flow.component.ComponentaddListener, 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.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifieraddAttachListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifieraddDetachListenerMethods inherited from interface com.vaadin.flow.component.HasStyleaddClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
- 
Field Details- 
NEW_ENTITY_ID- See Also:
 
- 
DEFAULT_ROUTE_PARAM- See Also:
 
- 
MODE_PARAM- See Also:
 
- 
MODE_READONLY- See Also:
 
- 
LOCKED_BEFORE_REFRESH_ATTR_NAME- See Also:
 
- 
READ_ONLY_BEFORE_REFRESH_ATTR_NAME- See Also:
 
- 
reloadSavedprotected boolean reloadSaved
 
- 
- 
Constructor Details- 
StandardDetailViewpublic StandardDetailView()Create views usingViewNavigatorsorDialogWindows.
 
- 
- 
Method Details- 
onDetachInternalprotected void onDetachInternal()- Overrides:
- onDetachInternalin class- View<ViewLayout>
 
- 
getSaveNotificationText
- 
beforeEnterpublic void beforeEnter(com.vaadin.flow.router.BeforeEnterEvent event) - Specified by:
- beforeEnterin interface- com.vaadin.flow.router.internal.BeforeEnterHandler
- Overrides:
- beforeEnterin class- View<ViewLayout>
 
- 
findEntityIdprotected void findEntityId(com.vaadin.flow.router.BeforeEnterEvent event) 
- 
getRouteParamName
- 
validateView
- 
isSaveActionPerformedprotected boolean isSaveActionPerformed()
- 
saveDescription copied from interface:DetailViewSaves changes.- Specified by:
- savein interface- DetailView<T>
 
- 
closeWithSaveDescription copied from interface:DetailViewSaves changes and closes the view.- Specified by:
- closeWithSavein interface- DetailView<T>
 
- 
closeWithDiscardDescription copied from interface:DetailViewDiscards changes and closes the view.- Specified by:
- closeWithDiscardin interface- DetailView<T>
 
- 
isShowSaveNotificationpublic boolean isShowSaveNotification()- Returns:
- whether a notification will be shown in case of successful save
 
- 
setShowSaveNotificationpublic void setShowSaveNotification(boolean showSaveNotification) Sets whether a notification should be shown in case of successful save. The default value istrue.- Parameters:
- showSaveNotification-- trueif a notification should be shown,- falseotherwise
 
- 
isShowValidationErrorspublic boolean isShowValidationErrors()- Returns:
- whether to indicate about errors after components validation
 
- 
setShowValidationErrorspublic void setShowValidationErrors(boolean showValidationErrors) Sets whether to indicate about errors after components validation. The default value istrue.- Parameters:
- showValidationErrors-- trueif notification needs to be shown,- falseotherwise
 
- 
isCrossFieldValidationEnabledpublic boolean isCrossFieldValidationEnabled()- Returns:
- trueif cross-field validation is enabled
 
- 
setCrossFieldValidationEnabledpublic void setCrossFieldValidationEnabled(boolean crossFieldValidationEnabled) Sets whether cross-field validation should be performed before saving changes. It usesUiCrossFieldChecksconstraint group to validate bean instance. The default value istrue.- Parameters:
- crossFieldValidationEnabled-- trueif cross-field should be enabled,- falseotherwise
 
- 
isReadOnlypublic boolean isReadOnly()- Specified by:
- isReadOnlyin interface- ReadOnlyAwareView
- Returns:
- whether a view is in read-only mode.
 
- 
setReadOnlypublic void setReadOnly(boolean readOnly) Description copied from interface:ReadOnlyAwareViewChanges the read-only mode.- Specified by:
- setReadOnlyin interface- ReadOnlyAwareView
- Parameters:
- readOnly-- trueto enable the read-only mode,- falseotherwise
 
- 
hasUnsavedChangespublic boolean hasUnsavedChanges()- Specified by:
- hasUnsavedChangesin interface- ChangeTracker
- Returns:
- trueif the view has unsaved changes
 
- 
getEditedEntityContainer
- 
getEditedEntityLoader
- 
getEditedEntity- Specified by:
- getEditedEntityin interface- DetailView<T>
- Returns:
- currently edited entity instance
 
- 
getEditedEntityOrNull- Specified by:
- getEditedEntityOrNullin interface- DetailView<T>
- Returns:
- currently edited entity instance or nullif not set
 
- 
setEntityToEditDescription copied from interface:DetailViewSets entity instance to the view.- Specified by:
- setEntityToEditin interface- DetailView<T>
- Parameters:
- entity- entity to edit
 
- 
setupEntityToEditprotected void setupEntityToEdit()Invoked onView.BeforeShowEventboth when the view is opened by navigation and in dialog window.
- 
setupEntityToEditInvoked when the view is opened by navigation.- Parameters:
- serializedEntityId- serialized id of the edited entity or- NEW_ENTITY_IDwhen creating new entity
 
- 
initNewEntity
- 
initExistingEntity
- 
setupEntityToEditInvoked when the view is opened in dialog window or when the view is opened by navigation andsetEntityToEdit(Object)method is called inAfterViewNavigationEventhandler.- Parameters:
- entityToEdit- entity instance to edit. Can be a new instance when the entity is being created, see- EntityStates.isNew(Object).
 
- 
getLockStatus- Specified by:
- getLockStatusin interface- DetailView<T>
- Returns:
- lock status of the currently edited entity instance. Possible variants:
 - LockStatus.NOT_SUPPORTED- if the entity does not support lock.
- LockStatus.LOCKED- if the entity instance is successfully locked.
- LockStatus.FAILED- if the entity instance has been locked when the view is opened.
 
 
- 
addInitEntityListenerprotected com.vaadin.flow.shared.Registration addInitEntityListener(com.vaadin.flow.component.ComponentEventListener<StandardDetailView.InitEntityEvent<T>> listener) Adds a listener toStandardDetailView.InitEntityEvent.- Parameters:
- listener- listener
- Returns:
- registration object for removing the listener
 
- 
addBeforeSaveListenerprotected com.vaadin.flow.shared.Registration addBeforeSaveListener(com.vaadin.flow.component.ComponentEventListener<StandardDetailView.BeforeSaveEvent> listener) Adds a listener toStandardDetailView.BeforeSaveEvent.- Parameters:
- listener- listener
- Returns:
- registration object for removing the listener
 
- 
addAfterSaveListenerprotected com.vaadin.flow.shared.Registration addAfterSaveListener(com.vaadin.flow.component.ComponentEventListener<StandardDetailView.AfterSaveEvent> listener) Adds a listener toStandardDetailView.AfterSaveEvent.- Parameters:
- listener- listener
- Returns:
- registration object for removing the listener
 
- 
addValidationEventListenerprotected com.vaadin.flow.shared.Registration addValidationEventListener(com.vaadin.flow.component.ComponentEventListener<StandardDetailView.ValidationEvent> listener) Adds a listener toStandardDetailView.ValidationEvent.- Parameters:
- listener- listener
- Returns:
- registration object for removing the listener
 
- 
isReloadEditedprotected boolean isReloadEdited()- Returns:
- true if the edited entity should be reloaded before setting to the data container.
 
- 
setReloadEditedprotected void setReloadEdited(boolean reloadEdited) Sets whether the edited entity should be reloaded before setting to the data container. True by default.Set to false in the view constructor or InitEventhandler if the view is opened in dialog mode and the entity should not be loaded by ID from a data storage.
- 
isReloadSavedpublic boolean isReloadSaved()- Specified by:
- isReloadSavedin interface- DetailView<T>
- Returns:
- true if edited entity should be reloaded after closeWithSave action, false otherwise
 
- 
setReloadSavedpublic void setReloadSaved(boolean reloadSaved) Description copied from interface:DetailViewSets whether edited entity should be reloaded after closeWithSave action.- Specified by:
- setReloadSavedin interface- DetailView<T>
- Parameters:
- reloadSaved- flag indicating whether edited entity should be reloaded after closeWithSave action
 
 
-