Class FragmentHandler


  • public class FragmentHandler
    extends Object
    Handler that makes sure that scroll to fragment and hash change event work when there has been navigation via router link to a path with fragment.

    This class will trigger scroll to fragment and hash change event once the response from server has been processed, but only if the server did not override the location.

    Since:
    1.0
    Author:
    Vaadin Ltd
    • Constructor Detail

      • FragmentHandler

        public FragmentHandler​(String previousHref,
                               String newHref,
                               Registry registry)
        Creates a new fragment handler.
        Parameters:
        previousHref - the href before the navigation
        newHref - the href being navigated into
        registry - the registry to bind to
    • Method Detail

      • bind

        public void bind()
        Adds a request response tracker to the given registry for making sure the fragment is handled correctly if the location has not been updated during the response.