Flexible layouts|Fragment for collapsable panel

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Flexible layouts|Fragment for collapsable panel

migueldeblas
Hi,

I try to implements a flexible layouts
https://www.thymeleaf.org/doc/tutorials/3.0/usingthymeleaf.html#flexible-layouts-beyond-mere-fragment-insertion

I need a fragment that implements a collapsable panel fragment (bootstrap). The contents of the panel may be other <div/th:block th:eplace.../> or static html.
I've tried but all my attempts have ended in Exception java.lang.StackOverflowError: null

frag.html
------------------------------------------
<div th:fragment="ANOTHER">
	<div><span>Test</span></div>
<div/>
...
<th:block th:fragment="AUDIT">
	<input type="hidden" th:field="*{createDate}"/>
	<input type="hidden" th:field="*{lastChangedate}"/>
</th:block>
....
<th:block th:fragment="COLLAPSE(title)">
<div class ="row">
	<a href="#" data-toggle="collapse" th:data-target="${'#' + title}" th:text="${title}">Title</a>
	<div th:id="${title}" class ="row collapse">
		<div class="panel panel-primary">
			<div class="panel-body">
				<th:block th:replace="~{:: ?????}"/>
			</div>
		</div>
	</div>
</div>
</th:block>
....
<div th:fragment="more" />
<th:block th:fragment="many" />
....

view.html
-----------------
<div th:replace="~{frag  :: COLLAPSE('Label_Audit')}">
	<div th:replace="~{frag :: AUDIT}"/>
	<div th:replace="~{frag :: ANOTHER}"/>
</div>

┬┐Do you have any solution?