private ComponentResources _resources;
@BeginRender
void begin(MarkupWriter writer)
{
final Field field = _field;
final Element element = writer.element("label");
_resources.renderInformalParameters(writer);
// Uh oh! Referencing a private field (that happens to get instrumented up the wazoo) from
// a inner class causes a java.lang.Verify error (Unable to pop operand off an empty stack).
// Perhaps this is a Javassist error? Shouldn't the inner class be going through a synthetic
// accessor method of some kind? Resolved by assigning to a local variable and referencing
// that. Layers on layers, oh my!
final ValidationDecorator decorator = _decorator;
// Since we don't know if the field has rendered yet, we need to defer writing the for
// attribute until we know the field has rendered (and set its clientId property). That's
// exactly what Heartbeat is for.
Runnable command = new Runnable()
{
public void run()
{
String fieldId = field.getClientId();
element.forceAttributes("for", fieldId);
decorator.insideLabel(field, element);
}