开发者

vaadin wth opening new window on clcik of menu command

I m using menu items which are given in vaadin menu demo example ,on click of each menu item i m showing notification message, but my requrement is i have 开发者_如何转开发to open new class on click of submenu item some one give me demo example in vaadin how open new window on click of menu item


Here's a short example showing how I open another top-level window in Vaadin. You have to supply a unique name for the window (the setName call). Then you call Vaadin to find the URL for the newly created window, and then open it. In this case "window" is a variable that holds my primary application window.

reportWindow = injector.getInstance(GeneralReportWindow.class);
reportWindow.setName("report_overview");
reportWindow.setGenerator(injector.getInstance(OverviewGenerator.class));

addWindow(reportWindow);

try {
    URI reportURI = reportWindow.getURL().toURI();
    URL windowURL = new URI(reportURI.getScheme(), 
        reportURI.getUserInfo(), reportURI.getHost(), 
        reportURI.getPort(), reportURI.getPath(), "report=overview", null).toURL();
    window.open(new ExternalResource(windowURL, "_new"));
} catch (Exception e) {
    log.warn("Unable to create report window", e);
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜