I’m trying to create a link (anchor) in GWT that can be clicked and it’s ClickEvent can be processed, while at the same time this anchor wouldn’t reload the page. This basically means that a href must not be set.
In javascript this is done like this:
<a href="javascript:handleAnchorClick();">Link</a>
or with
<a href="#" onclick="return handleAnchorClick()">Link</a>
where handleAnchorClick() returns false.
What would be the best way to achieve this in GWT?
Use tha Anchor element, and call its addClickListener() method and add in what ever logic you wish. This sort of anchor doesn’t reload the page.