View Full Version : Ext.History - doing it wrong?

29 Jul 2013, 3:45 PM
I'm trying to use Ext.History in my Web application, but I feel I'm missing something fundamental.

When a user makes a selection on my page's Form, I can use
Ext.History.add(newtoken, false, true); which adds a fragment to the URL of the page.
If I then navigate away and hit back, the fragment is still there in the URL (good), and on the Client side (once the page has loaded) I can use Ext.History.getToken() to retrieve the fragment, and manipulate things on the page.
My problem is - this is 'too late' as the server has already rendered the page.
I need the server to render things differently based on the history item, not the client.
According to the RFCs/specification, url fragments are purely client-side and aren't passed to the server.
Could someone point me in the right direction to implement a 'Back' history that passes state info to the server?

29 Jul 2013, 4:18 PM
I think the only way you're going to be able to implement something close to what you're wanting is if you use an AJAX request, based on the History state, to retrieve meta data from the server and use that to configure your Ext JS application as needed.

When using Ext JS History to go "back", there's not going to be another round-trip to the server, so the only way to inform your server of the change would be via an AJAX call.