Binding component to existing div

Hello everyone,

I am in need of layout like one at http://www.gridster.net , therefore I’ve written some code, but I have encountered problem.
I cannot inject any component into div that is created outside of vaadin (js file in this case) .
Basicly I am looking for what CustomLayout does: addComponent to existing HTML div.

How are you trying to do it exactly?
The only ways (as far as i can tell) to add a Vaadin component inside a layout created using html and JS (and not Vaadin) is by either using CustomLayout inside a Vaadin Application or by embedding an entire Vaadin Application inside another website.

That’s wham I am trying to estabilish: How CustomLayout does that, so I can do it on my own.
You said that to add Vaadin component inside a layout created using HTML and JS (and not Vaadin) is by using CustomLayout, how could I do that? When i create some layout using jQuery how could create CustomLayout without a template and use it on existing HTML?

Hi,

I think the most sophisticated way to do this would be to have client side GWT component (extends complexpanel) and server side wrapper for that.

In case you have your Vaadin app as “embedded” and you are doing some kind of mashup, where you want vaadin UI components rendered into some “slots” all over the host page, an add-on called
ExternalLayout
might fit for you.

cheers,
matti

Thanks that is exactly what I was looking for!

ExternalLayout doesn’t works with Vaadin 7.3. Unfortunately source doesn’t compile with 7.3 :frowning:

There is solution with Vaadin 14?

Matti Tahvonen:
Hi,

I think the most sophisticated way to do this would be to have client side GWT component (extends complexpanel) and server side wrapper for that.

In case you have your Vaadin app as “embedded” and you are doing some kind of mashup, where you want vaadin UI components rendered into some “slots” all over the host page, an add-on called [ExternalLayout]
(https://vaadin.com/directory#addon/externallayout:vaadin) might fit for you.

cheers,
matti

There is solution with Vaadin 14?

ron asis:
There is solution with Vaadin 14?

What do you mean by a solution? Are you looking for Gridster (or a similar add-on) or a way to add javascript in a Vaadin ?

In short, it should be simpler in Vaadin 14 but there is no vaadin 14 addon for gridster.