9

How can I user data-target="#userId" in a thymeleaf HTML doc. For like ,In any JSP or any HTML ,

<a href="#" data-toggle="modal" data-target="#resetPwModal${customer.uuid }">reset</a>

How I write in a thymeleaf HTML doc. like this?

<a href="#" data-toggle="modal" data-th-target="#resetPwModal${customer.uuid }">reset</a>

the exception is :

org.thymeleaf.exceptions.TemplateProcessingException: Could not parse as expression: "#" (user/userList.html:90)
Siguza
  • 21,155
  • 6
  • 52
  • 89
coolcao
  • 529
  • 1
  • 5
  • 8

2 Answers2

37
th:attr="data-target='#customerModel'+${customer.uuid }" 
coolcao
  • 529
  • 1
  • 5
  • 8
0
th:data-target="${'#customerModel'+customer.uuid}"
Sineth Lakshitha
  • 619
  • 6
  • 14
  • 2
    While this code may answer the question, providing additional context regarding *why* and/or *how* this code answers the question improves its long-term value. – Tân Dec 06 '19 at 15:54