/**
* Locate an UIComponent from its root component.
* @param base root Component (parent)
* @param id UIComponent id
* @return UIComponent object
*/
public static UIComponent findComponent(UIComponent base, String id)
{
if (id.equals(base.getId()))
return base;
UIComponent children = null;
UIComponent result = null;
Iterator childrens = base.getFacetsAndChildren();
while (childrens.hasNext() && (result == null))
{
children = (UIComponent) childrens.next();
if (id.equals(children.getId()))
{
result = children;
break;
}
result = findComponent(children, id);
if (result != null)
{
break;
}
}
return result;
}
...UIComponent component = findComponent( context.getViewRoot(),"treeTableId");...