## org.apache.myfaces.component.html.util
Class HtmlComponentUtils

    java.lang.Object
      org.apache.myfaces.component.html.util.HtmlComponentUtils

public class HtmlComponentUtils
extends java.lang.Object

Utility class for providing basic functionality to the HTML faces extended components.

Version:
  $Revision: 290952 $ $Date: 2005-09-22 10:48:48 -0400 (Thu, 22 Sep 2005) $
Author:
  Sean Schofield

Method Summary
`static javax.faces.component.UIComponent` `findParentNamingContainer(javax.faces.component.UIComponent component, boolean returnRootIfNotFound)` Locates the `NamingContainer` associated with the givem `UIComponent`.
`static java.lang.String` `getClientId(javax.faces.component.UIComponent component, javax.faces.render.Renderer renderer, javax.faces.context.FacesContext context)` Gets the client id associated with the component.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### getClientId

    public static java.lang.String getClientId(javax.faces.component.UIComponent component,
                                               javax.faces.render.Renderer renderer,
                                               javax.faces.context.FacesContext context)

  Gets the client id associated with the component. Checks the forceId attribute of the component (if present) and uses the orginally supplied id value if that attribute is true. Also performs the required call to `convertClientId` on the `Renderer` argument.

  Parameters:
    `component` - The component for which the client id is needed.
    `renderer` - The renderer associated with the component.
    `context` - Additional context information to help in the request.
  Returns:
    The clientId to use with the specified component.

### findParentNamingContainer

    public static javax.faces.component.UIComponent findParentNamingContainer(javax.faces.component.UIComponent component,
                                                                              boolean returnRootIfNotFound)

  Locates the `NamingContainer` associated with the givem `UIComponent`.

  Parameters:
    `component` - The component whose naming locator needs to be found.
    `returnRootIfNotFound` - Whether or not the root should be returned if no naming container is found.
  Returns:
    The parent naming container (or root if applicable).