Wednesday, September 8, 2010

Re: Combining href and clickHandler for an Anchor

On 7 sep, 16:23, Ståle Undheim <sta...@staale.org> wrote:
> I want to have an Anchor tag, with the href being a valid history
> token (for bookmarking, and middle click open in new window) and an
> onclick that sets the history token, but doesn't change the page.
>
> Basically I want the on click on the anchor to not result in a
> location change, even though there is a href on the anchor. This is
> because some view state (tree states and table sorted column state) is
> not part off the history, only where you are and what you are viewing.
>
> Is there another way so I can support right-click copy link and middle
> click open in new tabs for hrefs, while not leaving the page on left
> click? I have seen examples where the return off the inline javascript
> in onClick can stop the default. Event.preventDefault and
> Event.stopPropegation doesn't help me.

See http://code.google.com/p/google-web-toolkit/issues/detail?id=2901#c5
(make sure to follow the links back to this group for sample code)
FYI, HyperlinkImpl#handleAsClick has been added in response to issue
3061.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment