}
});
return uiData;
} else if (id.charAt(0) == ':' && parent instanceof OUIObjectIterator) {
id = id.substring(1);
final OUIObjectIterator iterator = (OUIObjectIterator) parent;
final String prevObjectId = iterator.getObjectId();
iterator.setObjectId(id);
if (restoreDataPointerRunnables != null)
restoreDataPointerRunnables.add(new Runnable() {
public void run() {
iterator.setObjectId(prevObjectId);
}
});
return (UIComponent) iterator;
} else if (isNumberBasedId(id)) {
Class clazz;
try {
clazz = Class.forName("com.sun.facelets.component.UIRepeat");
} catch (ClassNotFoundException e) {
clazz = null;
}
if (clazz != null && clazz.isInstance(parent)) {
final Object uiRepeat = parent;
ReflectionUtil.invokeMethod("com.sun.faces.facelets.component.UIRepeat", "setIndex",
new Class[]{Integer.TYPE}, new Object[]{Integer.parseInt(id)}, parent);
if (restoreDataPointerRunnables != null)
restoreDataPointerRunnables.add(new Runnable() {
public void run() {
// there's no getIndex method in com.sun.faces.component.UIRepeat, so we can't restore
// the index in this way here
}
});
return parent;
} else if (parent instanceof Columns) {
List<DynamicColumn> dynamicColumns = ((Columns) parent).toColumnList(context);
int columnIndex = Integer.parseInt(id);
final DynamicColumn dynamicColumn = dynamicColumns.get(columnIndex);
final Runnable restoreVariables = dynamicColumn.enterComponentContext();
if (restoreDataPointerRunnables != null)
restoreDataPointerRunnables.add(new Runnable() {
public void run() {
if (restoreVariables != null) restoreVariables.run();
}
});
return parent;
}
}
if (id.equals(parent.getId()))
return parent;
Iterator<UIComponent> iterator = parent.getFacetsAndChildren();
while (iterator.hasNext()) {
UIComponent child = iterator.next();
Object prependId = child.getAttributes().get("prependId");
if (child instanceof NamingContainer && !Boolean.FALSE.equals(prependId)) {
if (id.equals(child.getId()))
return child;
} else {