code: public static UIComponent getCompositeComponentParent(UIComponent component) {
  
          if (component == null) {
              return null;
          } else {
              if (component.compositeParent != null) {
                  return component.compositeParent;
              }
              UIComponent parent = component.getParent();
              while (parent != null) {
                  if (UIComponent.isCompositeComponent(parent)) {
                      if (component.isInView()) {
                          component.compositeParent = parent;
                      }
                      return parent;
                  }
                  parent = parent.getParent();
              }
              return null;
          }
          
      }
docs: <p>
  Finds the nearest composite component parent of the specified component.
  </p>
  
  @param component the component from which to start the search from
  
  @return if <code>component</code> is <code>null</code>, return
  <code>null</code>, otherwise search the component's parent hierachy
  for the nearest parent composite component.  If no parent composite
  component is found, return <code>null</code>
  
  @since 2.0