From 367c7751a6ff9234fd47bc5a48e6ef9a4117a7a2 Mon Sep 17 00:00:00 2001 From: Teemu Suo-Anttila Date: Wed, 27 Sep 2017 11:40:17 +0300 Subject: Add option to use PushState instead of URI fragments in Navigator (#10042) * Navigator now by default uses pushState and normal URLs * added documentation for pushState and updated Navigator documentation * improving docs etc, adding one TODO to be solved before merging * pushState/replaceState no work better with changing titles * Making uri fragment navigator work when not using specially mapped UI * Revert to older default, add annotation for selecting * Fix tests, add null checks * Reorder if-clause, fix tests * Revert unnecessary test change * Use correct variable in UI, fix test clean up * Updates to JavaDocs, fix some methods and tests * Add comments, fix test ui, TODO for fallbacks * Navigation documentation, JavaDocs, removed TODOs * Documentation fixes * Improve JavaDocs * Fix link name in documentation * Improve throws declaration in getLocation * Change documentation about the PushState based navigation * Add since tags * Add since tags for UI --- documentation/advanced/advanced-urifu.asciidoc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'documentation/advanced/advanced-urifu.asciidoc') diff --git a/documentation/advanced/advanced-urifu.asciidoc b/documentation/advanced/advanced-urifu.asciidoc index e245c8e727..e3b6b5c1ba 100644 --- a/documentation/advanced/advanced-urifu.asciidoc +++ b/documentation/advanced/advanced-urifu.asciidoc @@ -7,13 +7,16 @@ layout: page [[advanced.urifu]] = Managing URI Fragments +NOTE: This chapter contains instructions how to manage URI fragments. As browser support for HTML5 History API has improved, developers should in most cases developers instead use real URIs with _pushState_ method. Read more from +<>. + A major issue in AJAX applications is that as they run in a single web page, bookmarking the application URL (or more generally the __URI__) can only bookmark the application, not an application state. This is a problem for many applications, such as product catalogs and discussion forums, in which it would be good to provide links to specific products or messages. Consequently, as browsers remember the browsing history by URI, the history and the -[guibutton]#Back# button do not normally work. The solution is to use the +[guibutton]#Back# button do not normally work. The solution before HTML5 API was available was to use the __fragment identifier__ part of the URI, which is separated from the primary part (address + path + optional query parameters) of the URI with the hash (#) character. For example: @@ -31,7 +34,7 @@ the slash and the question mark. Vaadin offers two ways to enable the use of URI fragments: the high-level [classname]#Navigator# utility described in <> and the low-level API described here. +in an Application">> (if the legacy [classname]#UriFragmentManager# is configured for the Navigator) and the low-level API described here. [[advanced.urifu.setting]] == Setting the URI Fragment -- cgit v1.2.3