Question

How do I close the current browser tab? The following aren't working.

JavaScript.getCurrent().execute("window.close();");

or

UI.getCurrent().removeWindow(window);

or

window.close();
Was it helpful?

Solution

Try this:

Window appointmentWindow = getApplication().getWindow(NATIVE_WINDOW_NAME);
if (appointmentWindow != null) {
   getApplication().removeWindow(appointmentWindow);
}

Source: https://vaadin.com/forum/#!/thread/235330

OTHER TIPS

Try this.

gBrowser.removeCurrentTab();
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top