I have been calling my javascript function from Thymeleaf as below:
th:onclick="'viewDocument('' + ${document.docTypeLongDesc} +'');'"
But I just updated my spring boot version to 2.1.4 RELEASE with which Thymeleaf also got updated. And the previous version in no longer supported.
On further research I found out that I should be able to use
th:onclick="' viewDocument (this.getAttribute ('document.docTypeLongDesc'));'"
However, it doesn't give any error but neither does it work. I have removed the argument and was able to call the function just fine. So I am guessing I am not passing the argument right way. Any guidance will be helpful. TIA.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…