I was wondering why the Vaadin-GWT-Components don’t have an “ID” or a “NAME” . I know about
foo.setDebugId("myDebugId");
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.
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