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

@NullMarked public class StandardReadView<E> extends StandardView implements ReadView<E>
Base class of entity read views: views that show an entity instance and cannot edit it.
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • beforeEnter

      public void beforeEnter(com.vaadin.flow.router.BeforeEnterEvent event)
      Specified by:
      beforeEnter in interface com.vaadin.flow.router.internal.BeforeEnterHandler
      Overrides:
      beforeEnter in class View<ViewLayout>
    • processBeforeEnterInternal

      protected void processBeforeEnterInternal(com.vaadin.flow.router.BeforeEnterEvent event)
      Description copied from class: View
      CAUTION: for internal use only.
      Overrides:
      processBeforeEnterInternal in class View<ViewLayout>
      Parameters:
      event - before navigation event with event details
    • findEntityId

      protected void findEntityId(com.vaadin.flow.router.BeforeEnterEvent event)
    • getRouteParamName

      protected String getRouteParamName()
    • setupEntityToRead

      protected void setupEntityToRead()
      Invoked on View.BeforeShowEvent. Sets the entity id on the loader; the load itself is performed by the dataLoadCoordinator facet.
    • setEntityToRead

      public void setEntityToRead(E entity)
      Description copied from interface: ReadView
      Sets 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:
      setEntityToRead in interface ReadView<E>
      Parameters:
      entity - entity instance to show
    • setupEntityToRead

      protected void setupEntityToRead(E entityToRead)
      Invoked when the view is opened in a dialog window or when setEntityToRead(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

      public @Nullable E getEntityOrNull()
      Description copied from interface: ReadView
      Returns the currently shown entity instance or null if it isn't loaded yet.
      Specified by:
      getEntityOrNull in interface ReadView<E>
      Returns:
      currently shown entity instance or null if it isn't loaded yet
    • getEntityContainer

      protected InstanceContainer<E> getEntityContainer()
    • getEntityLoader

      protected InstanceLoader<E> 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 on View.ReadyEvent, i.e. after the view's own View.BeforeShowEvent handlers have created their components.