I have a little problem, I must return a different choice of a select into a td
using thymeleaf, I try the next sentence:
<td style="white-space: nowrap">
<span th:class="${linea.estado}? 'label label-success' : 'label label-danger' : 'label label-warning'"
th:text="${linea.estado}? #{label.glineas.estado.iniciado} : #{label.glineas.estado.finalizado} : #{label.glineas.estado.configurado}">
</span>
</td>
But I have a problem because the condition give me a big failure because is impossible to parse the expression. With only two conditions (iniciado and finalizado) there aren't problem, but I need to get the correct label for the select in my form.
Anybody knows the correct sentence to use a if elseif else sentence with thymeleaf?
2.0 Now I am trying to solve this problem with the next:
<td style="white-space: nowrap">
<span th:if="${linea.estado} == 'Iniciado'" class="label label-success" th:text="#{label.glineas.estado.iniciado}"></span>
<span th:if="${linea.estado} == 'Finalizado'" class="label label-danger" th:text="#{label.glineas.estado.finalizado}"></span>
<span th:if="${linea.estado} == 'Configuracion'" class="label label-warning" th:text="#{label.glineas.estado.configurado}"></span>
</td>
The solution is perfect, now all works properly. Thanks for all.