I found the solution. The problem is that theme
is an atrribute
and not a property
, and therefore needs to be defined with a $
suffix in the attribute-name. (only if the attribute value is being parsed using withProperty(..)
)
These work:
<vaadin-button theme$='[[item.theme] ]'>...</vaadin-button>
<vaadin-button theme='icon'>...</vaadin-button>
This doesn’t work:
<vaadin-button theme='[[item.theme] ]'>...</vaadin-button>
This was very arduous to find out, as there is absolutely no documentation on Template Renderers, except for the [basic introduction on the Docs for Grid]
(https://vaadin.com/docs/v14/flow/components/tutorial-flow-grid.html#using-template-renderers). I really hope the documentation on that gets massively improved
I only found it with the hardcoded warning message at TemplateRenderer::warnIfClassOrStyleWithoutDollar
, which only is about style
and class
attributes, but I figured this would apply to other attributes as well.