label.setRequired(true);
label.setOutputMarkupId(true);
label.add(new ErrorHighlighter());
add(label);
// intelligently set focus on right input field
add(new HeaderContributor(new IHeaderContributor() {
public void renderHead(IHeaderResponse response) {
if(field.getLabel() == null) {
response.renderOnLoadJavascript("document.getElementById('" + label.getMarkupId() + "').focus()");
} else if(optionField != null) {
response.renderOnLoadJavascript("document.getElementById('" + optionField.getMarkupId() + "').focus()");