I have a little problem with implementing in-page HTML anchors while also having bookmarkable URLs via hashbang. The description is easy:
- I visit some URL of my application: http://www.mypage.com/Test.html#!mycontent
On this page there is a lot of text and I need some HTML anchors for navigation. In old-style HTML I’d write <a href="#myAnchor">AnchorText</a>.
- But when I click this link in my GWT application, the URL changes to: http://www.mypage.com/Test.html#myAnchor
GWT Platform recognized the change and throws me back to my DefaultPlace. That’s clear because it can’t associate the URL to a presenter.
So now the (simple) question is: How can I use in-page navigation while also having hashbang URLs?
How do you construct your anchor?
In case you are doing it statically, why now just add the
!to the href?:<a href="!#myAnchor">AnchorText</a>Update:
Ok Instead of an normal
Anchoryou can use aHyperlinkorInlineHyperlinkand set thetargetHistoryTokenvalue to #!myAnchor: