// 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, "id", fieldId + ":label");
decorator.insideLabel(field, element);
}
};
_heartbeat.defer(command);
}