Issue Details (XML | Word | Printable)

Type: New Feature New Feature
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: driscoll
Votes: 4
Watchers: 2

If you were logged in you would be able to see more operations.

Ajax Back Button Support

Created: 24/Sep/09 12:14 PM   Updated: 27/Dec/13 10:30 PM
Component/s: Ajax/JavaScript
Affects Version/s: 2.0
Fix Version/s: 2.3

Time Tracking:
Not Specified


Operating System: All
Platform: All

Issue Links:

Issuezilla Id: 638
Status Whiteboard:

cat2 frame size_large importance_large draft

Participants: driscoll, Ed Burns, rogerk and werpu12

 Description  « Hide

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

driscoll added a comment - 08/Oct/09 12:36 PM

Ed Burns added a comment - 24/Nov/09 07:40 AM

Prepare to delete api subcomponent

Ed Burns added a comment - 04/Mar/10 01:51 PM


Ed Burns added a comment - 22/Mar/10 10:51 AM


Ed Burns added a comment - 15/May/10 07:54 AM

These are targeted at 2.1.

rogerk added a comment - 18/Jun/10 03:30 AM


Ed Burns added a comment - 22/Jun/10 05:52 AM

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.

Ed Burns added a comment - 22/Jun/10 09:04 PM


rogerk added a comment - 27/Oct/10 01:05 PM


rogerk added a comment - 16/Nov/10 12:38 PM


werpu12 added a comment - 06/Mar/12 03:20 PM

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.

werpu12 added a comment - 06/Mar/12 03:41 PM

werpu12 added a comment - 07/Mar/12 01:20 PM - edited

Ok I was able to enable back button support with some html 5 see following link

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.

werpu12 added a comment - 08/Mar/12 10:08 AM 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.