Thymeleaf Reset counter in nested foreach

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

Thymeleaf Reset counter in nested foreach

menglim
Is there anyway to reset counter in the nested foreach?

Please see my code below.

<div th:each="role, iter : ${roles}">
    <div th:text="role.Name">
        <div th:each="authority, iterAuth : ${authorities}" th:text="${authority.Name}">
        </div>
    </div> //reset iter to 0
</div>

After one loop in role, I would like to reset iter to 0 or whatever value.

It is possible?