SmartGWT客户端的轮询/间隔

Ben*_*and 3 smartgwt

我正在编写一个SmartGWT应用程序,需要每30秒在客户端执行一个方法.在javascript中我会使用setInterval或setTimeout.

我如何在SmartGWT中执行此操作?

zer*_*o_r 5

尝试使用计时器:

Timer t = new Timer() {
          public void run() {

             // do the callback here
          }
    };
    t.scheduleRepeating(30000); // repeat interval in milliseconds, e.g. 30000 = 30seconds
Run Code Online (Sandbox Code Playgroud)