-
1. Re: Implementing parent class for @Page annotated classes
jfuerth Mar 15, 2013 3:38 PM (in response to morfeus929)Hey Viktor,
Sounds like a great project! It can only lead to better UX insights when a dev team builds this kind of observability into an app!
All four of the page state annotations permit the target method 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 your case, but also 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).
So try this:
@PageShown
private void onPageShown(HistoryToken ht) {
GWT.log("Page showing: " + ht.getPageName());
}
Hope that helps!
Jonathan
[edit: due to a temporary lapse in sanity, I originally used the nonexistant "@PageState" annotation in the code snippet]