Question

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?

Était-ce utile?

La solution

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>
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top