html template component

Hello. I want to make a component container. It should accept html markup as string, some components, put the markup uto page and inject those components into it by IDs. I have made some almost “working” example:
https://github.com/asdnf/VaadinTemplater
but the button click in the example is never bein called. It even does not log into client console. I suppose it has not being bound to it’s handler. Please help me to understand how to properly make component contsiners. I suppose there is a lot of other mistakes.

Hi,

I’d suggest to consider following pattern:

  1. use some templating library like Velocity or Freemarker on the server side
  2. Use it to produce html, that you feed to
    CustomLayout
    , use the constructor that eats you template as InputStream
  3. Place dynamic parts (Vaadin components) to your CustomLayout

If I understood your requriements correctly, I think this is the best possible way to accomplish this.

cheers,
matti

Thank you Matti. That’s a great component.