2 Replies Latest reply on May 1, 2014 4:01 AM by Paul Wills

    Is Navigation Confirmation supported?

    Paul Wills Newbie

      From my initial review of Errai UI Navigation it appears that it does not support navigation confirmation as other frameworks such as GWT-Platform and Mvp4G. Is this correct?

       

      If it doesn't it would be beneficial if it did, as it can be used to notify the user of unsaved data changes on the page. It could work something like this.

       

      @Page

      public class SomePage extends Composite {

        ...

        @PageConfirmation

        public void confirm( NavigationEventCommand event ) {

         // ask the user what they want to do; "Leave page and loose changes or Stay on page"

         // of course the following code is in a callback from a pop-up dialog, so it must be asynchronous       

           if  (response = "LEAVE") {

                event.fireEvent();     // this results in the non-interruptible navigation

           }

        }

        ...

      }

       

      If the page has an annotated @PageConfirmation method then it has the chance to stop the navigation, alternatively without the @PageConfirmation the navigation is always non-interruptible.