com.vaadin.navigator.
Interface View
-
All Superinterfaces:
All Known Implementing Classes:
public interface View extends Serializable
Interface for all views controlled by the navigator. Each view added to the navigator must implement this interface. Typically, a view is a
Component
, if it is not then you should overridegetViewComponent()
to define the component to show for the view.Since:
7.0
Author:
Vaadin Ltd
-
-
Method Summary
All Methods Modifier and Type Method Description default void
beforeLeave(ViewBeforeLeaveEvent event)
Called when the user is requesting navigation away from the view.
default void
enter(ViewChangeListener.ViewChangeEvent event)
Called before the view is shown on screen.
default Component
getViewComponent()
Gets the component to show when navigating to the view.
-
-
-
Method Detail
-
enter
default void enter(ViewChangeListener.ViewChangeEvent event)
Called before the view is shown on screen.
The event object contains information about parameters used when showing the view, in addition to references to the old view and the new view.
Override this method to perform initialization of your view.
By default does nothing.
Parameters:
event
- an event object containing information about the parameters given by the user and references to the old view (if any)
-
beforeLeave
default void beforeLeave(ViewBeforeLeaveEvent event)
Called when the user is requesting navigation away from the view.
This method allows the view to accept or prevent navigation away from the view or optionally delay navigation away until a later stage. For navigation to take place, the
ViewBeforeLeaveEvent.navigate()
method must be called either directly when handling this event or later to perform delayed navigation.The default implementation calls
ViewBeforeLeaveEvent.navigate()
directly. If you override this and do nothing, the user will never be able to leave the view.This method is triggered before any methods in any added
ViewChangeListeners
. Whenever you callViewBeforeLeaveEvent.navigate()
, anyViewChangeListener
s will be triggered. They will be handled normally and might also prevent navigation.Parameters:
event
- an event object providing information about the event and containing theViewBeforeLeaveEvent.navigate()
method needed to perform navigationSince:
8.1
-
-