On 5 jan, 21:31, Brian <[email protected]> wrote: > Is History.getToken() broken? > > Upgraded to gwt 2.0.0 and the Speed Tracer plugin (Windows 7, 64bit, > Chrome), and noticed my app generated an infinite number of timer > timeouts. > > I got it down to a hello,world style app. This is the whole app: > > public class Test implements EntryPoint { > public void onModuleLoad() { > String token = History.getToken(); > RootPanel.get("block").add(new Label("hi")); > } > > } > > Run this app, and watch the result with the Speed Tracer plugin in > Chrome. I get a constant stream of: > > "Event Trace. Timer Fire. Duration 18ms. Time Type: setTimeout. > Interval 250ms" > > Remove the History.getToken() and all the timers go away. > > Any ideas?
This timer is the only way to detect that the URL's #hash part has changed (and therefore fire a ValueChangeEvent) ...at least until Chrome implements HTML5's onhashchange (as IE8 does already, and FF soon will in 3.6). This means that currently all GWT permutations except user.agent=ie8 use a timer. It that really annoys you, you can still try to provide your own HistoryImpl implementation that would not use a timer, for instance based on this trick http://ajaxian.com/archives/emulating-onhashchange-without-setinterval ;-)
-- 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.
