code: public static UIComponent getCompositeComponentParent(UIComponent component)
      {
  
          if (component == null)
          {
              return null;
          }
          UIComponent parent = component;
  
          do
          {
              parent = parent.getParent();
              if (parent != null && UIComponent.isCompositeComponent(parent))
              {
                  return parent;
              }
          } while (parent != null);
          return null;
      }
docs: search for the nearest parent composite component, if no parent is found
  it has to return null!
  
  if the component itself is null we have to return null as well!
  
  @param component the component to start from
  @return the parent composite component if found otherwise null
  
  @since 2.0