How to pass string variable to custom layout

Hi guys,

I use Vaadin 8 and custom layout to render some forms. I really like the approach, use HTML custom layout and render the components there but I wonder, is there any way,
how to pass String variable to custom layout and render it?
No Component, just simple text string.

There is example. Currently I have this in custom layout:

[code]

company-address
[/code]And I would like to replace the content of legend with some variable, something like this:

[code]

${company-address-legend}
[/code]Is there any way, how to do that?

This why we are using Polymer and web components in upcoming Flow / Vaadin Platform 10. It provides nice mechanisms for use cases like this, i.e. when you want to create custom component based on html template.

Technically speaking you could use same techniques with Vaadin 8 and html import. It requires some effort to do the connector, but it is possible. That approach would be future proof with our upcoming platform.

I just came across this blog post that you might find interesting:
https://blog.oio.de/2013/05/07/i18n-for-vaadin-applications-using-customlayouts-and-apache-velocity/

I haven’t tested it out, but it looks like what you are looking for.

-Olli

Thanks, that exactly what I want. I will try to use this solution, even-though it would be nice, if Vaadin would offer some way how to do it without external template engine.

I think Vaadin 10 is going to make that a bit easier, at least.

-Olli

Anyway, thanks much :slight_smile: I used freemaker with Vaadin and it’s working really nice.