Search code examples
buttonnavigationvaadinback

Avoid back button using vaadin


I develop RIA application using Vaadin CDI addon. About the app : it has two views(viewA and viewB) which maintained by Navigator. User story is pretty simple:

  1. User enters viewA
  2. Perform some business stuff
  3. Redirects to viewB
  4. Using address bar to go some external website(ex. google.com)
  5. Press back and it goes to he lastest page what he saw(viewB), instead of viewA

Any suggestions/tips-n-tricks how to avoid redirecting to viewB, but redirect to viewA?

Vaadin Forum quiet about this thing.

Thank you


Solution

  • You could override View.enter(...) in your ViewB, and, according to your application state, update your view URI using Page.getCurrent().setUriFragment(recentUrl, false);