Usage of FreeMarker syntax in screen's components

while developing my own “reset password link” functionality in CUBA, I noticed the following property string in a file (the one used by the ChangePasswordDialog):

caption = Change password<#if user?has_content &&> for user '${user.caption}'</#if>

I never found any mention in your docs that freemarker tags were supported in strings used by screen components.
Is that something provided by Vaadin OOB, or is it something developed specifically for CUBA?

Can I use this technique in my own screens, or is it something not supported officially (but that happens to work anyway)?


Hi Paolo,

Freemarker templates work only for screen captions and descriptions, i.e. not for all components. A template can use all screen parameters passed to it.

In fact, it’s a thing from the past, when we used Freemarker widely in screen layout and queries. Since then we decided that mixing layout and logic is not a good thing, especially from the perspective of supporting such “dynamic” templates in Studio. Using string interpolation in captions seems OK now, but we haven’t documented it as a not very useful feature that can be easily replaced by writing some normal code in controller.