code: public static UIForm getClosestForm(UIComponent component) {
  		while (component != null) {
  			if (component instanceof UIForm) {
  				return (UIForm) component;
  			}
  			component = component.getParent();
  		}
  		return null;
  	}
docs: Get the related form
  @param component
  @return