GWT:如何抑制超链接,以便不会更改我的历史记录 [英] GWT: How to suppress hyperlink so that it doesn't change my history token

查看:124
本文介绍了GWT:如何抑制超链接,以便不会更改我的历史记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使我的超级链接像按钮一样(仅响应Click事件),但是当您点击它们时,它们将自动更改历史记录,这会使我的应用程序中的历史记录机制变得混乱。有没有办法抑制超链接的默认行为,因此不会更改历史记录令牌?我尝试将targetHistoryToken设置为null,但没有起作用。

I want to make my hyperlinks act like buttons (only respond to Click event) however, they change the history token automatically when you click on them, which messes up my history mechanism in my application. Is there a way to suppress the default behaviour of the hyperlink so it doesn't change the history token? I tried setting targetHistoryToken to null but it didn't work.

谢谢,

推荐答案

使用 Anchor

作为 code>说:

As java doc of Hyperlink says:


如果您想要一个HTML超链接(标签)而不与
历史系统进行交互,请使用

If you want an HTML hyperlink ( tag) without interacting with the history system, use Anchor instead.

这篇关于GWT:如何抑制超链接,以便不会更改我的历史记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆