1

How can I open a view in a new window or tab? Currently I am using

getUI().getNavigator().navigateTo(viewname)

which works fine for switching of the view in same browser window. But I want to open a certain view in new tab/browser(chrom/IE, etc). How can I do that

user1631306
  • 4,350
  • 8
  • 39
  • 74
  • 1
    I recommend you put your view in a separate UI and use the BrowserWindowOpener. https://vaadin.com/docs/-/part/framework/advanced/advanced-windows.html – Axel Meier May 04 '17 at 08:05
  • 1
    You may find this example useful too: https://github.com/apm78/vaadin-basics/tree/master/src/main/java/de/akquinet/engineering/vaadin/exercises/theming – Axel Meier May 04 '17 at 08:09
  • 1
    In fact there is a predefined Vaadin object called Window for that. Place your view in the window and attach the window to your current view whenever you want to open it. – Thibstars May 16 '17 at 07:49
  • 1
    For Vaadin 8, see similar Question: [*Generate an HTML page, and open in a new window, from a Vaadin 8 app*](https://stackoverflow.com/q/51691041/642706). Instead of passing an `ExternalResource` as seen there, pass the `Class` object of your UI subclass, `MyOtherUI.class`. This is explained on the [*Handling Browser Windows*](https://vaadin.com/docs/v8/framework/advanced/advanced-windows.html) page of the manual. – Basil Bourque Aug 05 '18 at 02:55

0 Answers0