Ok, an update on progress in case anyone finds it usefull; The above overkill method does work; If the HTML is loaded as part of the main DOM, gwt hyperlinks changing the history token wont refresh the page anymore in IE.
If anyone else's use's this message, I'd suggest only using it for IE, and to put a message up blaming the users choice of browser for the extra second or two loading time. On May 21, 12:17 pm, twdarkflame <[email protected]> wrote: > Ok, I have come up with a work-around, but its such a kludge and > rather extreme, Id still be interested in other solutions to this > problem. (Id also like to here if its just IE6 or IE7/8 too, as I dont > have those installed). > > My preposed solution is thus; > > 1) Use a HTMLPanel rather then an iFrame > 2) Load the HTML into a string. > 3) Parse the string, swapping <a href= entrys for <div ID="blah">, > giving each a unique ID. > 4) Creating a Hyperlink object that has "#oldlinkurl" as its token. > 5) Place the Hyperlink objects in the HTMLPanel at the correct places > using "addAndReplaceElement" > 6) Add a historylistener to the main app that detects when the token > is set to a url, and then loads that new url into the HTMLpanel, > starting the whole process again from step 2. > > Now, I believe this will work, asIEdosnt refresh the page for > internal settings of the history token, only when a link is clicked. > > However, its naturally a rather ridiculous, not to mention slow, > method to go though. > > On May 18, 5:05 pm, darkflame <[email protected]> wrote: > > > > > Specificaly, it seems impossible to have a link within a Frame change > > the token of the parent (top) page, without the whole thing > > refreshing. > > > For instance this; > > >http://www.darkflame.co.uk/iFrame%20problem/FrameTest.html > > > Click on the links in firefox, and the token changes nicely. > > Click on the links inIE, and the whole page refreshs. > > > Now, the interesting thing is this problem only happens if the History > > is actualy used listened for. > > The code on that page is just; > > ========================================= > > public void onModuleLoad() { > > > //iframe > > Frame testFrame = new Frame(); > > > RootPanel.get().add(testFrame,100,100); > > testFrame.setSize("90%","90%"); > > testFrame.setUrl("2.html"); > > > //* REMOVE THIS LINE AND IT WORKS INIE* > > History.addValueChangeHandler(this); > > //* > > } > > > public void onValueChange(ValueChangeEvent<String> event) { > > String historyToken = event.getValue(); > > Window.alert("page changed to:"+historyToken); > > } > > ======================== > > (just a standard project made with the plugin, with that code, and the > > html you see used on the two pages) > > ======================== > > > My theory; > > > I'm guessing that by using the GWT history, the page is put into an > > extra frame which somehow stops the links from working without > > refreshing the page. Allthough refering to "top" in the javascript > > still has the same effect. > > > Interesting to note; The history changes first, then the page refreshs > > after....by a clear half second or so. > > > I hope someone can help with this, as this is actually a really major > > issue for my project. Using iFrames becomes kinda worthless to me if > > the historytokenscant be relied apon as a way to pass messages to > > the containing app. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---
