i have a page with lots of hrefs link to arbitrary points of the page, say when i click the link <a href="#b">B</a>
i should go to the point B. however i don't wanna update the history stack when i click the link, which by default will be udpate to /index.html#B
. i can use g:Anchor instead of hyperlink to avoid updating history stack, but how can i really go to the point B in my page? my code looks like this:
index.ui.xml
<g:Anchor ui:field="_a">A</g:Anchor>
...
<a name="a"></a>
<h3>Point A</h3>
<a name="b"></a>
<h3>Point B</h3>
...
index.java
@UiField
Anchor _a;
@UiHandler("_a")
void onClickA(ClickEvent e){
//how to goto point A in the page ??
}