2

I have a little problem with implementing in-page HTML anchors while also having bookmarkable URLs via hashbang. The description is easy:

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>.

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?

Benjamin M
  • 23,599
  • 32
  • 121
  • 201
  • Do you want the in-page navigation also be part of the history? Because whatever your solution will when you use old-style HTML tags they will become part of the history. So even if your code correctly works the browser will also put the in-page navigation on the history stack. – Hilbrand Bouwkamp Jul 19 '12 at 15:11

1 Answers1

0

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 Anchor you can use a Hyperlink or InlineHyperlink and set the targetHistoryToken value to #!myAnchor:

<g:InlineHyperlink ui:field="diversityLink" targetHistoryToken="!#myAnchor">MyAnchor</g:InlineHyperlink>
Ümit
  • 17,379
  • 7
  • 55
  • 74