Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Where is the "ID" and "NAME" Tag?
I was wondering why the Vaadin-GWT-Components don't have an "ID" or a "NAME" . I know about
but as the method suggest it is only for debugging. Is there a simple way to add an "ID" or a "Name"? I like to reference those fields via external Java-Script and thought that this would be the easiest way to do so.
#setDebugId is the canonical way set the ID attribute on the generated HTML eLement. Despite the name, it *is* always generated.
It is badly named, I agree, but there you have it; changing the method name would cause all sorts of backwards compatibility pain.
I do not believe that there is any way to set the NAME attribute.
 i.e. the correct, and indeed only way
thank you for the quick response. Do you know why the developer initially decided against names and ids? Is there a know issue or conflict using names and ids in Vaadin? I am just wondering since it seems as the easiest way to reference Vaadin generated objects from outside the actual application.
I've no idea - the original developer is probably hanging around here somewhere... I suspect it's probably related to the fact that Vaadin's orignal version didn't generate HTML at all, and so there was no such thing as an ID attribute to generate.
Using setDebugID to set the ID attribute on the HTML element works absolutely fine, and I would recommend you use it; Ihe only "bleuch" thing is that the method in Vaadin is called "setDebugId" not setId!
If you want a different approach, you could always add a css class name to the element (by Component#addStyleName), and search the DOM using JQuery or whatever, but I see no advantage over using id/setDebugId
Thanks again for the deeper look inside. I really appreciated it.