I have to add a form to a small piece of AJAX functionality implemented in GWT. In HTML terms, I'd like

<label for="personName">Name:</label><input type="text" size="50" id="personName"/>

It appears the Label widget in GWT simply renders as a DIV.

Ideally I would like clicking on the label text to focus the associated input. This is built-in browser functionality I don't want to have to mess around with ClickHandlers on label divs!

Has anyone faced this issue? Does exist as a built-in widget but is called something else?

EDIT: Have come up with the following. Maybe there is a better way?

HTML label = new HTML();
label.setHTML("<label for='"+input.getElement().getId()+"'>"+labelText+"</label>");
gwt
Edit
Report