Example usage for com.vaadin.server Page reload

List of usage examples for com.vaadin.server Page reload

Introduction

In this page you can find the example usage for com.vaadin.server Page reload.

Prototype

public void reload() 

Source Link

Document

Reloads the page in the browser.

Usage

From source file:org.adho.dhconvalidator.ui.LogoutLink.java

public LogoutLink() {
    super(Messages.getString("LogoutLink.title"));
    setStyleName(BaseTheme.BUTTON_LINK);
    addStyleName("plain-link");
    addClickListener(new ClickListener() {

        @Override/* w w  w  . jav a2 s .co m*/
        public void buttonClick(ClickEvent event) {
            List<Page> pages = new ArrayList<>();
            // keep the pages...
            for (UI ui : VaadinSession.getCurrent().getUIs()) {
                Page page = ui.getPage();
                if (page != null) {
                    pages.add(page);
                }
            }

            VaadinSession.getCurrent().close();

            // ... to notify them of the session close
            for (Page p : pages) {
                try {
                    p.reload();
                } catch (Exception e) {
                    Logger.getLogger("");
                }
            }
        }
    });
}