On 10 sep, 23:39, akumar <[email protected]> wrote:
> Hi,
>
> I am working on the browser history feature.
>
> Upon navigation from one state of the application to another state of
> the application - I like to programmatically set the browser window
> title.
>
> 1) Doing some lookup on the javadocs - there seems to be two ways to
> do this (don't know which one I should use) but - Document.get
> ().setTitle(...) and Window.setTitle(...) which is the right method to
> use ?

I wouldn't be as categorical as Sri on this one...
Document.get().setTitle(...) and Window.setTitle(...) are *exactly*
equivalent, so use the one you prefer depending on your context...

> 2) is it true, that history tokens also get attached to the browser
> title - as I see # token in the browser title as well (not sure, if it
> is bug in my code) or default behaviour?

That's a browser behavior (I'd call it a bug in the browser if you ask
me). As Sri said, History doesn't do anything with the document's
title.
IMO, the workaround is to set the title before calling History.setItem
() (if you're using a Hyperlink, this means attaching a ClickHandler
and setting the title there) so that your browser's history will use
the appropriate title for the "bookmarked" state –be it a bookmark or
just an entry in the browser's history list–, *and* also set it in
response to history change (eventually in a deferred command or
timer).

That being said, having looked recently at ReallySimpleHistory's
source code, they're setting the hidden iframe's document title too;
so maybe GWT's History should do that automatically too and that might
be the reason your title is replaced/being appended with the history
token (in IE 6 and 7 only, as other browsers don't use the hidden
iframe).
I'm almost sure I already seen this behavior on Google Reader on
Chrome, so maybe there's actually no workaround that either you or
GWT's History could use...
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to