Hi, i would like to use a sub-layout in a dom-repeat block.
While
<dom-module id="parent-layout">
<template>
<h1>Parent</h1>
<sub-layout></sub-layout>
</template>
...
</dom-module>
works (having a @Uses(SubLayout.class) annotation in the ParentLayout Java-Class), the following does not work:
<dom-module id="parent-layout">
<template>
<h1>Parent</h1>
<dom-repeat items="{{myItems}}">
<template>
<sub-layout></sub-layout>
</template>
</dom-repeat>
</template>
...
</dom-module>
The following Exception occurs:
ERROR com.vaadin.flow.router.InternalServerError - There was an exception while trying to navigate to ''
java.lang.IllegalArgumentException: Unable to create an instance of 'com.test.markus.ui.ParentLayout'. The constructor threw an exception.
(...)
Caused by: java.lang.IllegalStateException: Couldn't parse the template 'frontend://src/views/parent-layout.html': sub-templates are not supported. Sub-template found:
'<sub-layout></sub-layout>'
Is there a way to achieve such a behavior?
I’m using Vaadin 10.