Found it! And it works. It should be separated by comma.
HTML forbids repeated attributes, so that code is not correct. However, th:attr and data-th-attr allow you to specify several attributes separated by commas, like:
<a href="#" data-th-attr="data-groupid=${somevalue},
data-groupname=${someothervalue}">...</a>
found it on this discussion: https://github.com/thymeleaf/thymeleaf/issues/93