Update Vaadin App

How can I restart the Vaadin app when I click the button?

I read what I add? Restarting the application in the URL will be restarted, but which method is called?

+4
source share
2 answers

I'm not sure if this is exactly what you are looking for, but you can use the close method from the application class

public void close() 

In essence, this will cause the application to stop returning any windows upon request. When the application is closed, its state is removed from the session, and the browser window is redirected to the application exit URL set using setLogoutURL (String). If the exit URL is not set, the browser window restarts and the application restarts.

+1
source

Just put the content of your choice in mainwindow:

 //add listener to button sendButton.addListener(new Button.ClickListener() { public void buttonClick(ClickEvent event) { //reload page mainWindow.setContent(buildUserPage()); } } 
-1
source

Source: https://habr.com/ru/post/1446395/


All Articles