Open externál URL with menuBar

Hi!

I would like to open an external url in menubar.

mainMenu.addItem(“Vaadin URL”, new Command() {
public void menuSelected(MenuItem selectedItem) {
getMainWindow().open(new ExternalResource(“http://www.vaadin.com”, “_new”));
}

It works, but it opens in same window. I would like to open it in new window. How can I do this?

Thanks
Tamás

Never actually tried it (I’m working in a portal-environment) but instead of opening the URL in your Applivcation’s main Window you should add another one and use that for opening the URL.

Try using “_blank” instead of “_new”:

getMainWindow().open(new ExternalResource("http://www.vaadin.com"), "_blank");

Thanks, but doesn’t work with “_blank” too :frowning:

Strange, I am using it and it works pretty well.

getMainWindow().open(new ExternalResource(“http://www.vaadin.com”), “_self”); it works

Is there any news on this issue? I am looking for a way to have an external link inside a menu and it seems to be impossible. I tried it like this:
menuItem.addItem("Visit Vaadin", new Command() { public void menuSelected(MenuItem selectedItem) { Page.getCurrent().open("https://vaadin.com", "_blank"); } }); But web browsers will block this depending on their settings. They don’t block normal links though.

Is there no LinkMenuItem yet?