Menu link to external URL in v7?


I am trying to create an external link (google groups) directly from a menu item. This was asked and answered for v6, but the WindowManager is deprecated now. What is the correct way to implement this in v7?


If you take a look into javadocs of the WindowManager#showWebPage method, you will see the suggestion to use another method:

     * Open a web page in browser.
     * <br>
     * It is recommended to use {@link WebBrowserTools} instead.
     * @param url    URL of the page
     * @param params optional parameters.
     *               <br>The following parameters are recognized by Web client:
     *               <ul>
     *               <li>{@code target} - String value used as the target name in a
     *      call in the client. This means that special values such as
     *               "_blank", "_self", "_top", "_parent" have special meaning. If not specified, "_blank" is used.</li>
     *               <li> {@code width} - Integer value specifying the width of the browser window in pixels</li>
     *               <li> {@code height} - Integer value specifying the height of the browser window in pixels</li>
     *               <li> {@code border} - String value specifying the border style of the window of the browser window.
     *               Possible values are "DEFAULT", "MINIMAL", "NONE".</li>
     *               </ul>
     *               Desktop client doesn't support any parameters and just ignores them.
     * @see WebBrowserTools#showWebPage(String, Map)
    void showWebPage(String url, @Nullable Map<String, Object> params);
 * It is recommended to use {@link WebBrowserTools} instead.
 * @see WebBrowserTools#showWebPage(String, Map)

WebBrowserTools can be injected to any v7 screen.

When I try to execute the WebBrowserTools, I get this:

Screen is:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<window xmlns=""

Controller is:

package com.paslists.merges.web.screens;

import com.haulmont.cuba.gui.WebBrowserTools;
import com.haulmont.cuba.gui.screen.Screen;
import com.haulmont.cuba.gui.screen.Subscribe;
import com.haulmont.cuba.gui.screen.UiController;
import com.haulmont.cuba.gui.screen.UiDescriptor;

import javax.inject.Inject;

public class Googledatagroup extends Screen {

    private WebBrowserTools webBrowserTools;

    public void onInit(InitEvent event) {
        webBrowserTools.showWebPage("", ImmutableMap.of("target","_top"));

I am running 7.1.3:

What did I do wrong?

So, I managed to get access to the WebBrowserTools object like this:

public class Googledatagroup extends Screen {

    private WebBrowserTools webBrowserTools;

    public void onInit(InitEvent event) {
        AppUI ui = AppBeans.get(AppUI.class);
        webBrowserTools = ui.getWebBrowserTools();

Unfortunately, it doesn’t seem to do anything. I get a blank page. When I watch the network interaction, I see this after clicking the Menu item. There is no data transfer from an external web page.

I tried switching the link to:


Still a blank page. Suggestions?


The correct way to obtain WebBrowserTools is:


Adding menu item with a link to external URL requires creating a class that can be used as a menu item, e.g.:

public class ExternalUrlDemoRunner implements Runnable {
    public void run() {
                .showWebPage("", null);


<menu-config xmlns="">
    <menu id="application-demo" insertBefore="administration">
        <item id="external-link-demo"