Ticket #34 (closed enhancement: fixed)

Opened 2 years ago

Last modified 2 months ago

Low level: Bookmarking and History support

Reported by: Marc Englund Owned by: Matti Tahvonen
Priority: minor Milestone: User Interface Library 5.3.0 RC
Component: WebTerminalAdapter Version:
Keywords: Cc:
Known Issue description:
Hours estimate: 8 Deadline (dd.mm.yyyy):
Known Issue version (since): Known Issue title:
Hours done: Depends to:
Affects documentation: no
Known Issue workaround:
Affects release notes: no Contract:

Description (last modified by Joonas Lehtinen) (diff)

Component that corresponds to the browser back button

Provides server-side api for maintaining a list of caption+token pairs (history). Updates browser history to correspond to the server-side list, and triggers events (selected history item = token) as appropriate.

Make GWT history API accessible from server-side.

Change History

Changed 2 years ago by Marc Englund

  • priority changed from undefined to trivial
  • hours_left set to 8
  • component changed from undefined to Ajax

Changed 2 years ago by Sami Ekblad

It could be useful to take a look GWT API and implementation of this feature.

Changed 8 months ago by Marc Englund

  • summary changed from Advanced Backbutton to Bookmarking and History support
  • affects_documentation unset
  • affects_release_notes unset

Also remember bookmarking (!) support. This might actually be more often needed than backbutton. We could pass # to the server from the client; that is: window.open("#someid") changes the url, but does not reload the page; exactly what we want. But the server can not read the #someid when browsing to http://someurl#someid, so it's currently not usable for bookmarking. We could pass the #someid to the server in a uidl-request after the client has loaded though, in the first uidl request.

Changed 8 months ago by Joonas Lehtinen

  • priority changed from trivial to undefined
  • milestone set to IT Mill Sponsored Backlog

Changed 8 months ago by Marc Englund

A partial solution - these changes will make the hash (#) in the url go trough to the parameterHandler:

ApplicationConnection.java:

    public ApplicationConnection(WidgetSet widgetSet,
            ApplicationConfiguration cnf) {

        [...SNIPPED...]

        String hash = getLocationHash();
        makeUidlRequest("repaintAll=1"
                + (hash != null && hash.length() > 1 ? "&hash=" + hash : ""));
        applicationRunning = true;
    }

    /**
     * Get uri hash
     * 
     * @return the hash (fragment) part of the url
     */
    private native static String getLocationHash()
    /*-{
        
        return $doc.location.hash;
    }-*/;

CommunicationManager.java:232, before variable handling:

                // Handle parameters
                final Map parameters = request.getParameterMap();
                if (window != null && parameters != null) {
                    window.handleParameters(parameters);
                }

Note however that GWT history should also be in use before enabling this, otherwise the backbutton will cause problems.

Changed 3 months ago by Jouni Koivuviita

  • milestone changed from IT Mill Sponsored Backlog to User Interface Library 5.3.0 RC

Upping this, since we could really, _very_ really, use this in our upcoming new feature browser. Any chances of getting it in 5.3.0?

Changed 3 months ago by Joonas Lehtinen

  • priority changed from undefined to minor
  • description modified (diff)
  • summary changed from Bookmarking and History support to Low level: Bookmarking and History support

Changed 2 months ago by Matti Tahvonen

  • owner changed from Marc Englund to Matti Tahvonen
  • status changed from new to accepted

Changed 2 months ago by Matti Tahvonen

  • status changed from accepted to closed
  • resolution set to fixed

Low level UriFragmentUtility? component committed in [5883].

It is just a simple invisible (0x0 sized) component so does not need any major API changes to core framework. With UriFragmentUtility? added to GUI developer can:

  • read current uri fragment (part of uri after # character)
  • set it (makes step into browsing history -> enables backbutton, changes url -> makes application state bookmarkable)
  • listen to changes ( application can react to back/forward button clicks)

Minor inconvenience is that the initial fragment is not known at first render. If fragment is initially null on server side, client side will updated after first render (to "" if empty so listener will fire).

Later we might add features like a view framework or breadcrumb components that uses services provided by this component.

Note: See TracTickets for help on using tickets.