Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to refresh a vaadin page with the refresh button

I need to refresh the page in vaadin. I created a Refresh Button but the button is not working for refreshing the page.

Button Refresh = new Button("Refresh");
Refresh.addClickListener(new Button.ClickListener() {
    @Override
    public void buttonClick(Button.ClickEvent clickEvent) {
    }
});
like image 237
dhS Avatar asked Nov 27 '22 10:11

dhS


2 Answers

For Vaadin 10:

Call this in your Button ClickListener:

    UI.getCurrent().getPage().reload();
like image 117
AndyW Avatar answered Dec 18 '22 05:12

AndyW


Call this in your Button ClickListener:

Page.getCurrent().reload();

This reloads the page in the browser.

like image 36
Axel Meier Avatar answered Dec 18 '22 03:12

Axel Meier