0

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?

S. Doe
  • 685
  • 1
  • 6
  • 25

1 Answers1

3

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?

  • Interesting info that the tag defines the webcomponent. I thought that the used webcomponent template is dependent of the Java class, not dependent of the tag. By changing the tag name I wanted the HTML code to be consistent with all the other specific HTML elements like "vaadin-text-field", "vaadin-combo-box", "vaadin-split-layout", "vaadin-vertical-layout", .... Ok, then it seems that using the `@Tag` here is just wrong in my context. Thank you! – S. Doe Jan 21 '21 at 10:58