return null;
}
final String id = tag.getAttribute(getWicketNamespace(markupStream) + WICKET_FOR).trim();
Component component = findRelatedComponent(container, id);
if (component == null)
{
throw new ComponentNotFoundException("Could not find form component with id '" + id +
"' while trying to resolve wicket:for attribute");
}
if (!(component instanceof ILabelProvider))
{
throw new WicketRuntimeException("Component pointed to by wicket:for attribute '" + id +
"' does not implement " + ILabelProvider.class.getName());
}
if (!component.getOutputMarkupId())
{
component.setOutputMarkupId(true);
if (component.hasBeenRendered())
{
logger.warn(
"Component: {} is referenced via a wicket:for attribute but does not have its outputMarkupId property set to true",
component.toString(false));
}
}
if (component instanceof FormComponent)
{
component.setMetaData(MARKER_KEY, new AutoLabelMarker((FormComponent<?>)component));
}
return new AutoLabel("label" + container.getPage().getAutoIndex(), component);
}