Person person = (Person) object;
String username = (person != null) ? person.getUsername() : null;
final HtmlComponent container = super.createTextField(username, type);
final HtmlFormComponent formComponent = (HtmlFormComponent) container.getChild(new Predicate<HtmlComponent>() {
@Override
public boolean apply(HtmlComponent input) {
return input instanceof HtmlFormComponent;
}
});
formComponent.setConverter(new PersonUsernameConverter());
return formComponent;
}