Search code examples
vaadinvaadin-flowvaadin10

Vaadin CustomField with Tag has no Label


In my Vaadin (14.4.6) application I've got a CustomField like this one: https://vaadin.com/components/vaadin-custom-field/java-examples

When I add a @Tag annotation to my CustomField implementation, the label and error elements are gone.

This is how the HTML is like in Firefox without the @Tag annotation:

HTML of a Vaadin CustomField without Tag annotation

This is how the HTML is like in Firefox with the @Tag annotation:

HTML of a Vaadin CustomField with Tag annotation

Is there a way to set a custom tag name at a CustomField without losing the label and the error elements?


Solution

  • The CustomField is linked to a webcomponent with the Tag vaadin-custom-field so if you add a tag it will use a different webcomponent, in your case chart-field.

    Why do you want to change the tag?