I have this piece of code in my Thymeleaf template but it does not work properly since this is the location generated
deviceevent/@%7B/deviceevent/list/%7Bid%7D(id=$%7BdeviceEvent.id%7D)%7D
in the template
<tr th:each="deviceEvent : ${deviceEvents}" onclick="window.location.href = '@{/deviceevent/list/{id}(id=${deviceEvent.id})}'" >
Thymeleaf doesn't evaluate attributes unless they are prefixed with th
. In this case, th:onclick
. The complete string should look like this:
th:onclick="'window.location.href = \'' + @{/deviceevent/list/{id}(id=${deviceEvent.id})} + '\''"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With