I have one vaadin 7 application with two UIs:
@SuppressWarnings("serial")
@Theme("app")
@Push
public class AppUI extends UI {
@WebServlet(value = "/*", asyncSupported = true)
@VaadinServletConfiguration(productionMode = false, ui = AppUI.class)
public static class Servlet extends VaadinServlet {
}
...
}
@SuppressWarnings("serial")
@Theme("app")
@Push
public class AuxUI extends UI {
@WebServlet(value = "/aux/*", asyncSupported = true)
@VaadinServletConfiguration(productionMode = false, ui = AuxUI.class)
public static class Servlet extends VaadinServlet {
}
...
}
I embeeded them into one static page:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=10;chrome=1" />
<link rel="shortcut icon" type="image/vnd.microsoft.icon"
href="/vaadin7app/VAADIN/themes/app/favicon.ico" />
<link rel="icon" type="image/vnd.microsoft.icon"
href="/vaadin7app/VAADIN/themes/app/favicon.ico" />
</head>
<body>
<p>Here is title</p>
<div id="vaadin7app1" class=" v-app app" >
<div class=" v-app-loading"></div>
<noscript>You have to enable javascript in your browser to
use an application built with Vaadin.</noscript>
</div>
<p>Here is separator</p>
<div id="vaadin7app2" class=" v-app app" >
<div class=" v-app-loading"></div>
<noscript>You have to enable javascript in your browser to
use an application built with Vaadin.</noscript>
</div>
<p>Here is footer</p>
<iframe tabindex="-1" id="__gwt_historyFrame"
style="position: absolute; width: 0; height: 0; border: 0; overflow: hidden"
src="javascript:false"></iframe>
<script type="text/javascript"
src="/vaadin7app/VAADIN/vaadinBootstrap.js"></script>
<script type="text/javascript">//<![CDATA[
if (!window.vaadin) alert("Failed to load the bootstrap javascript: /vaadin7app/VAADIN/vaadinBootstrap.js");
if (typeof window.__gwtStatsEvent != 'function') {
vaadin.gwtStatsEvents = [];
window.__gwtStatsEvent = function(event) {vaadin.gwtStatsEvents.push(event); return true;};
}
vaadin.initApplication("vaadin7app1",{
"browserDetailsUrl": "/vaadin7app/",
"serviceUrl": "/vaadin7app/",
"widgetset": "com.vaadin.DefaultWidgetSet",
"vaadinDir": "/vaadin7app/VAADIN/",
"theme": "app",
"debug": true,
"heartbeatInterval": 300,
"standalone": false,
"authErrMsg": {
"caption": "Authentication problem",
"message": "Take note of any unsaved data, and <u>click here<\/u> to continue."
},
"comErrMsg": {
"caption": "Communication problem",
"message": "Take note of any unsaved data, and <u>click here<\/u> to continue."
},
"sessExpMsg": {
"caption": "Session Expired",
"message": "Take note of any unsaved data, and <u>click here<\/u> to continue."
},
"versionInfo": {"vaadinVersion": "7.1.8"}
});
vaadin.initApplication("vaadin7app2",{
"browserDetailsUrl": "/vaadin7app/aux/",
"serviceUrl": "/vaadin7app/aux/",
"widgetset": "com.vaadin.DefaultWidgetSet",
"vaadinDir": "/vaadin7app/VAADIN/",
"theme": "app",
"debug": true,
"heartbeatInterval": 300,
"standalone": false,
"authErrMsg": {
"caption": "Authentication problem",
"message": "Take note of any unsaved data, and <u>click here<\/u> to continue."
},
"comErrMsg": {
"caption": "Communication problem",
"message": "Take note of any unsaved data, and <u>click here<\/u> to continue."
},
"sessExpMsg": {
"caption": "Session Expired",
"message": "Take note of any unsaved data, and <u>click here<\/u> to continue."
},
"versionInfo": {"vaadinVersion": "7.1.8"}
});
//]]></script>
</body>
</html>
Is there way to get reference to the one UI from the two UI on server side? I want to influence on the one UI’s state from another UI.
Thanks in advanced!