public interface View extends Serializable
Component
, if it is not then you should override
getViewComponent()
to define the component to show for the view.Modifier and Type | Method and 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.
|
default void enter(ViewChangeListener.ViewChangeEvent event)
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.
event
- an event object containing information about the parameters
given by the user and references to the old view (if any)default void beforeLeave(ViewBeforeLeaveEvent event)
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 call
ViewBeforeLeaveEvent.navigate()
, any ViewChangeListener
s
will be triggered. They will be handled normally and might also prevent
navigation.
event
- an event object providing information about the event and
containing the ViewBeforeLeaveEvent.navigate()
method
needed to perform navigationCopyright © 2018 Vaadin Ltd. All rights reserved.