Thymeleaf: Only variable expressions returning numbers or booleans are allowed in this context
You have to move your Thymeleaf expressions to th:data-*
attributes, and use this.getAttribute('...')
instead. Something like this for example:
<tr th:each="menuPriceSummary: ${menus}" >
<a href="#"
th:data-icon="|idAwesomeIconFAV${menuPriceSummary.menu.symbol}|"
th:data-url="@{/allmenupricesummary/switchfav/{id}(id=${menuPriceSummary.menu.symbol})}"
onclick="changeAIColor(this.getAttribute('data-icon')); performAjaxCall(this.getAttribute('data-url'));">
<span th:if="${menuPriceSummary.favorited}">
<i th:id="'idAwesomeIconFAV'+${menuPriceSummary.menu.symbol}" class="fa fa-toggle-on fa-lg" style="color:#009900; text-align: center;" aria-hidden="true"></i>
</span>
<span th:if="${!menuPriceSummary.favorited}">
<i th:id="'idAwesomeIconFAV'+${menuPriceSummary.menu.symbol}" class="fa fa-toggle-off fa-lg" style="color:#e6e6e6;" aria-hidden="true"></i>
</span>
</a>
</tr>