*/
public class RepeatRenderer extends RendererBase {
public void encodeChildren(FacesContext context, UIComponent component)
throws IOException {
final UIRepeat repeater = (UIRepeat) component;
repeater.captureOrigValue(context);
try {
DataVisitor visitor = new DataVisitor() {
public void process(FacesContext context, Object rowKey, Object argument) throws IOException {
repeater.setRowKey(rowKey);
ListIterator childIterator = repeater.getChildren()
.listIterator();
while (childIterator.hasNext()) {
UIComponent child = (UIComponent) childIterator.next();
renderChild(context, child);
}
}
};
repeater.walk(context, visitor, null);
} finally {
repeater.restoreOrigValue(context);
repeater.setRowKey(null);
}
}