@Target(value=METHOD) @Retention(value=RUNTIME) @Documented public @interface PageShowing
Page it is a member of is
about to be displayed in the navigation content panel: after the page's PageState fields
have been updated and before it is displayed in the navigation content panel.
When the client-side application is bootstrapping (the page is loading in the browser), the
Navigation system waits until all Errai modules are fully initialized before displaying the
initial page. Hence, it is safe to make RPC requests and to fire portable CDI events from within
a PageShowing method.
The target method is permitted an optional parameter of type HistoryToken. If the
parameter is present, the framework will pass in the history token that caused the page to show.
This is useful in cases where not all history token key names are known at compile time, so
@PageState fields can't be declared to accept their values.
The target method is permitted an optional parameter of type NavigationControl. If the
parameter is present, the page navigation will not be carried out until
NavigationControl#proceed() is invoked. This is useful for redirecting navigation before
a page has been displayed, based on asynchronous logic (for example, to redirect to another page
based on the result of an Errai RPC).
Page loading can be interrupted by calling NavigationControl#redirect(Class). This allows
for page redirection rather than proceeding a pages navigation. The target method's return type
must be void.
The target method can have any access type: public, protected, default, or private.
If the target method throws an exception when called, behaviour is undefined.
Page,
PageState,
Navigation,
PageShownCopyright © 2020 Treblereel. All rights reserved.