【问题标题】:How to make runtime changes to a Vaadin component after loading如何在加载后对 Vaadin 组件进行运行时更改
【发布时间】:2019-07-31 12:45:56
【问题描述】:

从另一个 Vaadin 页面导航到页面后,如何使用计时器动态更改 Vaadin h1 元素?

导航

start.addClickListener(e->{
    ActorCallsHandler.ach.startGame();
    UI.getCurrent().navigate(Playboard.class);
});

public class Playboard extends VerticalLayout
{
    private H1 timer;

    public Playboard() throws ExecutionException, InterruptedException{
        generateGUI();
    }

    private void generateGUI(){
      //h1 element that should alter using a timer after page load
      H1 timer = new H1(); 
    }
}

【问题讨论】:

    标签: vaadin


    【解决方案1】:

    为此,您需要使用 Vaadin 的推送或轮询功能,以便可以随时将更改发送到客户端,而不仅仅是响应由某些用户操作触发的请求。

    我建议您查看 https://vaadin.com/docs/v13/flow/advanced/tutorial-push-configuration.html 的推送功能文档。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-09-05
      • 1970-01-01
      • 2020-07-15
      • 2017-05-31
      • 1970-01-01
      • 2013-04-20
      • 1970-01-01
      相关资源
      最近更新 更多