}
if (related == null)
{
// ...or it might just not be available.
String forAttr = forAttributeValue != null ? " for=\"" + forAttributeValue + "\"" : "";
throw new ComponentNotFoundException("no related component found for <wicket:label"+forAttr+">");
}
else
{
// ...found the form component, so we can return our label.
return new TextLabel("label" + container.getPage().getAutoIndex(), related);