I have a generic thymeleaf
table as follows:
<tbody>
<th:block th:each="row : ${page.getContent()}">
<tr>
<td th:each="header : ${headers}" th:text="${row.__${header}__}"/>
</tr>
</th:block>
</tbody>
The table is simply backed by a list containing my domain objects:
List<Header> headers = List.of("firstname", "lastname");
List<Person> page;
What it does is: it loops my predefined list headers
, and selects only those attributes defined in the headers list.
Question: how could I add an evaluation on the classtype of the extracted value of each field, so that I could apply a custom style in case of digits?
The problem is: when I output the class of the value that is shown, the output is a java.util.ArrayList
always!
th:text="${{row.__${header}__}.class.name}"
Why doesn't this show the correct class of the td
element?