@Override
protected void onBeforeRender()
{
super.onBeforeRender();
// If we're part of a BeanForm, register ourself with it.
BeanForm parentBeanForm = findParent(BeanForm.class);
if (parentBeanForm != null) {
this.beanForm = parentBeanForm;
parentBeanForm.registerComponent(this, (BeanPropertyModel)getDefaultModel(), elementMetaData);
if (parentBeanForm.getFocusField() != null
&& parentBeanForm.getFocusField().equals(
elementMetaData.getPropertyName())) {
FormComponentVisitor focusFinder = new FormComponentVisitor();
visitChildren(focusFinder);
}