Frage

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();
War es hilfreich?

Lösung

Try this:

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

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

Andere Tipps

Try this.

gBrowser.removeCurrentTab();
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top