1 Reply Latest reply on Jun 7, 2013 11:27 AM by Jonathan Fuerth

    Implementing parent class for @Page annotated classes

    Viktor Chekh Newbie

      Hi guys!


      I have to make parent class for @Page annotated classes in my project and implement couple methods in there. Basically the main purpose of this class will be tracking time that user has spent on the particular page and showing which page user goes to after he left this one. I was able to track the time with using @PageShown  and @PageHiding annotiations. But now i have no idea how to implement functionality for showing the name of the page user goes to. Could you please share your thougths on this issue?


      Thanks, Viktor

        • 1. Re: Implementing parent class for @Page annotated classes
          Jonathan Fuerth Master

          Hi Viktor,


          Sorry I missed your question until now.


          The navigation framework will pass the current history token to either of the page lifecycle methods @PageShowing and @PageShown. All you need to do is declare an argument of type HistoryToken on one of those methods, like this:


          public void onPageShowing(HistoryToken ht) {
            Window.alert("Welcome to the page called " + ht.getPageName());


          Hope that helps!