Usage pattern
class MyComponent extends ComponentSupport { selectionMgr = new SelectionMgr(); public Document render(RequestContext context) throws Exception { Document document = XmlUtils.createDocument(); selectionMgr.startRendering(context); for (int nodeIndex = 0; nodeIndex < nodeCount; nodeIndex++) { Object node = ... Element elem = renderElement(node); selectionMgr.renderButton(element, node); } selectionMgr.stopRendering(); return document; } public boolean validate(RequestContext context) { selectionMgr.validate(context); ... } }