[JAVASERVERFACES_SPEC_PUBLIC-638] Ajax Back Button Support Created: 24/Sep/09  Updated: 12/Aug/14

Status: Open
Project: javaserverfaces-spec-public
Component/s: Ajax/JavaScript
Affects Version/s: 2.0
Fix Version/s: None

Type: New Feature Priority: Major
Reporter: driscoll Assignee: Unassigned
Resolution: Unresolved Votes: 5
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issue Links:
Dependency
blocks JAVASERVERFACES_SPEC_PUBLIC-718 Allow PhaseListener instances to rece... Closed
blocks JAVASERVERFACES_SPEC_PUBLIC-542 autocomplete attribute missing on for... Open
Issuezilla Id: 638
Status Whiteboard:

cat2 frame size_large importance_large draft


 Description   

Many modern Ajax frameworks support back button actions.

JSF should as well.

This probably means both browser history manipulation and state restoration.
Could be pretty hard to do, but really important for being seen as a real Ajax
solution.



 Comments   
Comment by driscoll [ 08/Oct/09 ]

Also, see here for a newly proposed standard by Google:

http://googlewebmastercentral.blogspot.com/2009/10/proposal-for-making-ajax-crawlable.html

Comment by Ed Burns [ 24/Nov/09 ]

Prepare to delete api subcomponent

Comment by Ed Burns [ 04/Mar/10 ]

unscheduled

Comment by Ed Burns [ 22/Mar/10 ]

frame

Comment by Ed Burns [ 15/May/10 ]

These are targeted at 2.1.

Comment by rogerk [ 18/Jun/10 ]

triage

Comment by Ed Burns [ 22/Jun/10 ]

On 5 May 2010, at the JAX conference, this feature was requested, but in a slightly different guise. The
requestor wanted something like

<h:backButton ...> with an optional "number of views to go back" attribute.

Comment by Ed Burns [ 22/Jun/10 ]

rogerk

Comment by rogerk [ 27/Oct/10 ]

triage

Comment by rogerk [ 16/Nov/10 ]

triage

Comment by werpu12 [ 06/Mar/12 ]

Ok Ajax back button support is tricky at best. I will investigate the following days into this issue. I know html5 will provide an official api and there are hacks which enable it via hashtags on the url. (the hashtag hacks also enable bookmarking for ajax)

I personally think in step 1 we should aim for the standardized html5 way of doing things and then aim lower with the hasthags which open another can of worms.

Comment by werpu12 [ 06/Mar/12 ]

https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history

is interesting information regarding this.

Comment by werpu12 [ 07/Mar/12 ]

Ok I was able to enable back button support with some html 5 see following link
https://gist.github.com/1993051

A detailed blog will follow. The problem i see is, that there are several approaches.
a) The simplest is to go for the pure html5 way. Then you have to snapshot the page and restore it upon a proper back button event.

b) The probably easiest one is, to enable the same by adding a html5 storage simulation and back button simulation to the page (and use hashtash for the back button simulation). This should be doable, or by simply storing the page shots in a javascript map.

c) The third one would be to enable something else via hashes in the url, that would need some server side patching additionally.

I will try to prototype approach b) tomorrow.

Comment by werpu12 [ 08/Mar/12 ]

https://gist.github.com/2000091 here is the same prototype for html4 browsers.

The problem i see here with both methods is, they are purely clientside, and rely on the state history to recover the correct state.
So they

a) need some kind of notification how deep the state history is to prevent states which result in an error.

b) it is still unclear on how to deal with embedded scripts in the page and onload handlers which rely on component initialisation.

We probably have to add a callback event which the component systems can hook in to reintialize their stuff, or we simply execute all embedded scripts even with the danger of getting sideffects.

Comment by Ed Burns [ 01/Aug/14 ]

Set priority to baseline ahead of JSF 2.3 triage. Priorities will be assigned accurately after this exercise.

Generated at Sat Feb 06 12:35:48 UTC 2016 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.