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
* window.open 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.
So, I managed to get access to the WebBrowserTools object like this:
public class Googledatagroup extends Screen {
private WebBrowserTools webBrowserTools;
@Subscribe
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.