Package io.jmix.flowui.view
Class StandardReadView<E>
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.Composite<ViewLayout>
io.jmix.flowui.view.View<ViewLayout>
io.jmix.flowui.view.StandardView
io.jmix.flowui.view.StandardReadView<E>
- Type Parameters:
E- 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,FacetOwner,FragmentOwner,ReadView<E>,Serializable
- Direct Known Subclasses:
TemplateReadView
Base class of entity read views: views that show an entity instance and cannot edit it.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class io.jmix.flowui.view.View
View.AfterCloseEvent, View.BeforeCloseEvent, View.BeforeShowEvent, View.InitEvent, View.PostReadyEvent, View.QueryParametersChangeEvent, View.ReadyEvent, View.RestoreComponentsStateEvent -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidMakes data-bound components of the view read-only and disables actions that adjust themselves when a view is read-only.voidbeforeEnter(com.vaadin.flow.router.BeforeEnterEvent event) protected voidfindEntityId(com.vaadin.flow.router.BeforeEnterEvent event) protected InstanceContainer<E> protected InstanceLoader<E> @Nullable EReturns the currently shown entity instance ornullif it isn't loaded yet.protected Stringprotected voidprocessBeforeEnterInternal(com.vaadin.flow.router.BeforeEnterEvent event) CAUTION: for internal use only.voidsetEntityToRead(E entity) Sets the entity instance to show.protected voidInvoked onView.BeforeShowEvent.protected voidsetupEntityToRead(E entityToRead) Invoked when the view is opened in a dialog window or whensetEntityToRead(Object)is called explicitly.Methods inherited from class io.jmix.flowui.view.View
addAfterCloseListener, addApplicationListeners, addBeforeCloseListener, addBeforeShowListener, addInitListener, addQueryParametersChangeListener, addReadyListener, addRestoreComponentsStateEventListener, afterNavigation, beforeLeave, close, close, closeWithDefaultAction, configureDialogWindowFooter, configureDialogWindowHeader, getApplicationContext, getEventBus, getId, getPageTitle, getReturnParameters, getViewActions, getViewAttributes, getViewData, getViewFacets, getViewSupport, isPreventBrowserTabClosing, onAttach, onAttachInternal, onDetach, onDetachInternal, removeApplicationListeners, removeViewAttributes, setAfterNavigationHandler, setApplicationContext, setId, setPageTitle, setPreventBrowserTabClosing, setViewActions, setViewData, setViewFacets, unregisterBackNavigationMethods inherited from class com.vaadin.flow.component.Composite
getChildren, getContent, getElement, initContentMethods inherited from class com.vaadin.flow.component.Component
addListener, bindVisible, findAncestor, fireEvent, from, get, getListeners, getLocale, getParent, getTestId, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setTestId, setVisible, whenAttachedMethods 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, bindClassName, bindClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
-
Field Details
-
DEFAULT_ROUTE_PARAM
- See Also:
-
-
Constructor Details
-
StandardReadView
public StandardReadView()Create views usingViewNavigatorsorDialogWindows.
-
-
Method Details
-
beforeEnter
public void beforeEnter(com.vaadin.flow.router.BeforeEnterEvent event) - Specified by:
beforeEnterin interfacecom.vaadin.flow.router.internal.BeforeEnterHandler- Overrides:
beforeEnterin classView<ViewLayout>
-
processBeforeEnterInternal
protected void processBeforeEnterInternal(com.vaadin.flow.router.BeforeEnterEvent event) Description copied from class:ViewCAUTION: for internal use only.- Overrides:
processBeforeEnterInternalin classView<ViewLayout>- Parameters:
event- before navigation event with event details
-
findEntityId
protected void findEntityId(com.vaadin.flow.router.BeforeEnterEvent event) -
getRouteParamName
-
setupEntityToRead
protected void setupEntityToRead()Invoked onView.BeforeShowEvent. Sets the entity id on the loader; the load itself is performed by thedataLoadCoordinatorfacet. -
setEntityToRead
Description copied from interface:ReadViewSets the entity instance to show. The view reloads the instance by its id, so what is displayed always matches the view's fetch plan.- Specified by:
setEntityToReadin interfaceReadView<E>- Parameters:
entity- entity instance to show
-
setupEntityToRead
Invoked when the view is opened in a dialog window or whensetEntityToRead(Object)is called explicitly. Puts the id of the given instance on the loader, so the shown entity is read through the view's own fetch plan.- Parameters:
entityToRead- entity instance to show
-
getEntityOrNull
Description copied from interface:ReadViewReturns the currently shown entity instance ornullif it isn't loaded yet.- Specified by:
getEntityOrNullin interfaceReadView<E>- Returns:
- currently shown entity instance or
nullif it isn't loaded yet
-
getEntityContainer
-
getEntityLoader
-
applyReadOnlyState
protected void applyReadOnlyState()Makes data-bound components of the view read-only and disables actions that adjust themselves when a view is read-only. Invoked onView.ReadyEvent, i.e. after the view's ownView.BeforeShowEventhandlers have created their components.
-