GWT自动刷新 [英] GWT auto refresh

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

问题描述

我正在GWT项目中工作。根据要求,我必须提供自动刷新到我的屏幕之一。
我的老人告诉我在该页面中使用< meta http-equiv =refreshcontent =300>



但是由于GWT代码只用java编写,所以我不知道如何在java文件中使用它。



有人可以帮忙?

解决方案

取决于您如何管理历史记录以及是否不使用场所。您可以在计时器内使用位置重新加载事件。



如果您正在使用地点,则可以使用地点控制器每30秒重新导航到相同地点

  Timer t = new Timer(){
public void run(){
Window.Location.reload();
}
};
t.scheduleRepeating(30000);
}


I am working in GWT project. As per the requirement, i have to provide auto-refresh to one of my screen. My senior told me to use <meta http-equiv="refresh" content="300"> in that screen page.

But as GWT code is written in java only, so i wonder how can I use it in java file.

Can somebody help?

解决方案

Depending on how you are managing history and if you are not using places. You can use the location reload event inside a timer.

If you are using places, you can use your place controller to re navigate to the same place every 30 seconds

  Timer t = new Timer() {
      public void run() {
       Window.Location.reload();
      }
    };
    t.scheduleRepeating(30000);
  }

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

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