Vaadin redirecting to a URL from button click

荒凉一梦 提交于 2019-12-07 00:18:26

问题


I have searched for a long time, but I really cannot figure this out.

How do I redirect the user to a new external link (e.g. www.google.com) when they click a button in Vaadin?

The only thing I have managed to do so far is to put the link into a link

Link link = new Link("link", new ExternalResource("http://www.google.com"));

Can anyone help me out with this please?


回答1:


getUI().getPage().setLocation("http://www.google.com");

References: Page (Vaadin 7.2.1 API) and Vaadin application lifecycle (Book of Vaadin).



来源:https://stackoverflow.com/questions/24012682/vaadin-redirecting-to-a-url-from-button-click

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!