Add Vaadin 7 root(s) to an HTML page


I’m trying to understand we’re (or will be) able to inject one or more Vaadin root into an HTML page, just like I do with GWT. All examples use web.xml to serve a root via URL. Instead, I’d like to dynamically add some Vaadin toolbars in a preexisting page, so that the user can click on the buttons and open Vaadin windows inside the page. Those windows will then contain my application features.

Is this easy, hard or impossible?


I’m not sure if what you mean is really dynamically injecting applications - do you add GWT modules to the page after the page has been loaded? Most GWT linkers do not really support that but maybe xsilinker (used by default in Vaadin 7) does. Or do you just mean e.g. generating the GWT start-up code on the HTML page before it is served to the browser but then dynamically interacting with the DOM?

For Vaadin 6, e.g. the add-on
Vaadin XS
makes embedding a Vaadin application on a page easy (in addition supporting cross-domain embedding), or one can copy the generated HTML code and paste it on a static page. The related parts have changed a lot in Vaadin 7 and while there are plans to make such embedding much easier than with Vaadin 6, at the moment it is likely to be quite a lot harder in Vaadin 7.

Depending on how the rest of the page is generated, it might also be simpler to use a single Vaadin application and place its components in various locations on the page. The add-on
might help you there (make sure you get the Vaadin 7 version of it).