GWT历史问题 [英] GWT History Problem

查看:185
本文介绍了GWT历史问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



History.newItem(Register);



该网址正确地变为

http://127.0.0.1:8888/BiddingSystem.html?gwt.codesvr=127.0.0.1:9997#Register



并加载注册表格



,但是网址会自动更改为

http://127.0.0.1:8888/BiddingSystem.html?gwt.codesvr=127.0 .0.1:9997#



为什么?



因为我想保持为 p>

http://127.0.0.1:8888/BiddingSystem.html?gwt.codesvr=127.0.0.1:9997#Register



让用户可以重新加载

解决方案

问题是,我正在使用超链接来执行点击处理程序。有超链接,事件如果你放置一个空字符串,它会改变url。



例如。如果当前的URL类似于 http:... //#This ,并且超链接有一个空的目标历史令牌,则url将更改为 http:... //#。



我用过的解决方案是因为我不想使用一个按钮,我使用标签并添加一些CSS来使它看起来像一个超链接



例如

 标签寄存器=新标签(寄存器); 
Label.setStyleName(FalseHyperlink);

然后在css中

  .FalseHyperlink 
{
颜色:蓝色;
}

.FalseHyperlink:hover
{
text-decortion:underline;





$ b

这个解决方案适用于我,因为我对其他超链接服务不感兴趣,例如作为访问或其他人


when i am adding a new history item like this

History.newItem("Register");

the url correcly changes to

http://127.0.0.1:8888/BiddingSystem.html?gwt.codesvr=127.0.0.1:9997#Register

and loads the register form

but then the url automatically rechanges to

http://127.0.0.1:8888/BiddingSystem.html?gwt.codesvr=127.0.0.1:9997#

why??

because I want to remain as

http://127.0.0.1:8888/BiddingSystem.html?gwt.codesvr=127.0.0.1:9997#Register

so that user can reload

解决方案

The problem is that I was using an hyperlink for acting like a click handler. with a hyperlink, event if u place an empty string, it gonna change the url.

e.g. if the current URL is something like http:...//#This and a hyperlink has an empty target history token then, the url is to change to http:...//#.

The solution i used that worked for me is that because i does not want to use a button, i make use of label and adding some css to it to make it look like a hyperlink

for e.g.

Label Register= new Label("register");
Label.setStyleName("FalseHyperlink");

then in the css

.FalseHyperlink
{
   color:blue;
}

.FalseHyperlink:hover
{
   text-decortion:underline;
}

Here this solution worked for me because i was not interested in other hyperlink services such as visited or others

这篇关于GWT历史问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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