From Springboot I create an attribute having a list as value:
attributes.addFlashAttribute("mylist", mylist);
On client-side a need to pass this list to a javascript function. I used:
<th scope="col">
<i class="fas fa-plus" type="button"
th:onclick="|myfunction('staticValue', [[${mylist}]]);|">
</i>
</th>
The result is that the th tag disappear from the table. The javascript works when I do not use the thymeleaf attribute. I'm using thymeleaf 3.0.15.
As suggested I'm also using with no success:
<i class="fas fa-plus" type="button"
th:data-materialTypeSetDes="${mylist}"
onclick="function('staticValue', this.getAttribute('data-materialTypeSetDes'));"></i>
Listshould be shown - something likedata-materialTypeSetDes="[foo, bar]". A MRE may make this clearer.