View Full Version : History Object IE Bug?

5 Nov 2009, 4:10 AM
I have been doing some scouring to prevent posting a duplicate, but having issues with IE6,7 and the history object (haven't tested in 8). It appears that the history object is not registering the initial page when it loads. To duplicate, I used the history example.

for my test:
1.launch http://www.google.com in a browser
2.paste in http://www.extjs.com/deploy/dev/examples/history/history.html#tab1:subtab1 into the address bar of that window.
3.click tab 2
4.click back button

At that point the browser jumps back to google, skipping the first page, and this seems to be specific to IE browsers. Any one else with any similar behaviors or have a work around?


5 Nov 2009, 4:54 AM
how about setting the activeTab to tab 1 and sub-tab1

5 Nov 2009, 5:28 AM

Thanx for the reply. The way I am using the history object was suggested in one of the other threads, where I add the history, and allow the change event to fire the logic I need. In trying to get this to work, I forced a blank token in for my page, which causes my logic to load the blank page. I ran into 2 issues with this, the first was that it threw ff into an infinite loop for some reason. The 2nd was mixed. I placed and Ext.isIE so it specifically looked for IE. When they went back after clicking tab 2, it did work. The problem came if they clicked back one more time, then went forward. At that point, all forward history was lost. I know in other browsers there is window.history.next that you can use to see if there was future history, and I could have used to say if is IE and has future history, but .next doesn't work in IE.

5 Nov 2009, 5:46 AM
i must admit i cannot follow?!
in your example everything works fine...
when you click a few tabs and then clcik back a few times, you can go forward just as easily...
it's only when you click again on a tab that your history(future) is lost, as it is lost by surfing the internet...

5 Nov 2009, 6:08 AM
I think what he means is he tried to set the active tab, by forcing it as you suggested. He just gave a lot of details :) But by forcing the activeTab (moreso than you already see in the history.js in the sample), it caused an infinite loop OR causes you to lose your forward history. . . He didn't post a link for that attempt as he was showing the actual ext site (not his attempts to modify said example).

The problem is on the actual EXT example, which you only see manifesting itself in Internet Explorer. You can clearly see how if you come from google, load the page (which has tab 1 by default), click on tab 2, then finally click the back. It skips tab 1 (which is already set in Ext history.js to be active) and goes back to the referring page.

5 Nov 2009, 7:59 AM
it's because there is no listener on the first tab... you've set the listener to the subtabs...
you need to do both

5 Nov 2009, 9:21 AM
I would not expect to have to add a listener at that point, I physically told the browser where I want it to go. This is why I believe it is a bug in Ext. The sample I sent of how to reproduce it does not cause the same page skipping issue in firefox or safari.

Take the example a step farther...

load google, go to history page then do not click a tab and go to google again, or another web page through the address bar. When you click back, it goes back to the history example without it being registered, it does not skip over the page to go back to page before.

:) again, I appreciate all your help.

If a moderator is reading, could you let me know if I should have posted in Bugs forum as that is what this seems to be?


8 Jul 2010, 4:46 AM
6 months later we are still experiencing this issue. We're using Ext 3.1.1. Anyone else noticing this?

8 Jul 2010, 6:31 AM
could you post your code please, maybe Then i'm able to understand your problem exactly...

8 Jul 2010, 7:52 AM
Greetings again,

The problem is the same as it was before, so updating my first post.....and to be sure you can see....

Open a new browser window.

Go to a web page of your choice, for example, I will http://www.google.com
next copy the following link, not click...


and paste into the window you opened above and go to the page.

Click "Tab 2"

Click the browser Back Button

The page does not go back to Tab 1 as it should, it goes back to Google.

This appears to be an IE only thing, if you follow the steps above in FF, it works.

If you need any other clarification, I can try, but in termsof the one poster above, the Ext history example code posted serves as sample.


8 Jul 2010, 11:10 PM
When you click on another tab, it should work... meaning you should go back to tab2 before going back to google...

// Ignore tab1 since it is a separate tab panel and we're managing history for it also.
// We'll use its handler instead in that case so we don't get duplicate nav events for sub tabs.
if(tab.id != 'tab1'){
Ext.History.add(tabPanel.id + tokenDelimiter + tab.id);

this is used so we do not add tab 1 as a history-page because it has child tabs which are used to add as history...
if you add after creating the main tab-panel the next code, your first call of the page will be recorded as wel...

tp.on('afterrender', function() {
Ext.History.add('tab1' + tokenDelimiter + 'Sub-tab 1');

I hope it helps...