Costum component tag

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Costum component tag

fanzyThymeleafUser
Hi Guys. I some questions regarding the name of a costum component:
Is there any limitation for the name? Length? Reserved names?

I have created a costum dialect and added a new processor that generates an input field. My dialect prefix is "tk" and the component name is for example "inputField". This means I would call this component with "tk:inputField". This didn't work. So I thought inputField is reserved and changed it to "inputTextField" and I tried to call it with "tk:inputTextField". Same result... So I changed the name of the component to "itf" and called it with "tk:itf" and it worked. Why?!

Please explain..

Kr

ftu
Reply | Threaded
Open this post in threaded view
|

Re: Costum component tag

fanzyThymeleafUser
Ok. If I don't use camel case for my tags it is working. Is this intended?
Reply | Threaded
Open this post in threaded view
|

Re: Costum component tag

Emanuel
Administrator
I don't know if there are any name restrictions on custom tags - I couldn't find mention of it in the documentation.  Maybe since HTML tags are all lower case then custom tags might need to be too?
Reply | Threaded
Open this post in threaded view
|

Re: Costum component tag

Emanuel
Administrator
In reply to this post by fanzyThymeleafUser
I just noticed this issue appearing on the Thymeleaf GitHub page:

Custom element processors do not match lower-case tag names: https://github.com/thymeleaf/thymeleaf/issues/100

Targeted for the Thymeleaf 2.0.15 release, so you could wait for the new version (or the 2.0.15 snapshot when this issue is fixed) and switch your custom element names back to camel case, or go all lower case in the meantime.