Class ComponentTraversalUtils

java.lang.Object
org.primefaces.util.ComponentTraversalUtils

public class ComponentTraversalUtils extends Object
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> List<T>
    children(Class<T> type, javax.faces.component.UIComponent base)
     
    static <T> T
    closest(Class<T> type, javax.faces.component.UIComponent base)
     
    static <T> T
    closest(Class<T> type, javax.faces.component.UIComponent base, boolean considerBase)
     
    static javax.faces.component.UIForm
    closestForm(javax.faces.component.UIComponent component)
     
    static javax.faces.component.UIForm
    closestForm(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
    Deprecated.
    use closestForm(UIComponent component)
    static javax.faces.component.UIComponent
    closestNamingContainer(javax.faces.component.UIComponent component)
     
    static javax.faces.component.UniqueIdVendor
    closestUniqueIdVendor(javax.faces.component.UIComponent component)
     
    static <T> T
    first(Class<T> type, javax.faces.component.UIComponent base)
     
    static void
    firstById(String id, javax.faces.component.UIComponent base, char separatorChar, javax.faces.context.FacesContext context, javax.faces.component.ContextCallback callback)
    Finds the first component by the given id expression or client id.
    static javax.faces.component.UIComponent
    firstWithId(String id, javax.faces.component.UIComponent base)
    Finds the first component with the given id (NOT clientId!).
    static void
    withId(String id, javax.faces.component.UIComponent base, List<javax.faces.component.UIComponent> components)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • closest

      public static <T> T closest(Class<T> type, javax.faces.component.UIComponent base)
    • closest

      public static <T> T closest(Class<T> type, javax.faces.component.UIComponent base, boolean considerBase)
    • first

      public static <T> T first(Class<T> type, javax.faces.component.UIComponent base)
    • children

      public static <T> List<T> children(Class<T> type, javax.faces.component.UIComponent base)
    • withId

      public static void withId(String id, javax.faces.component.UIComponent base, List<javax.faces.component.UIComponent> components)
    • firstWithId

      public static javax.faces.component.UIComponent firstWithId(String id, javax.faces.component.UIComponent base)
      Finds the first component with the given id (NOT clientId!). Also used by p:resolveFirstComponentWithId.
      Parameters:
      id - The id.
      base - The base component to start the traversal.
      Returns:
      The component or null.
    • firstById

      public static void firstById(String id, javax.faces.component.UIComponent base, char separatorChar, javax.faces.context.FacesContext context, javax.faces.component.ContextCallback callback)
      Finds the first component by the given id expression or client id.
      Parameters:
      id - The id.
      base - The base component to start the traversal.
      separatorChar - The separatorChar (e.g. :).
      context - The FacesContext.
      callback - the callback for the found component
    • closestForm

      @Deprecated public static javax.faces.component.UIForm closestForm(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
      Deprecated.
      use closestForm(UIComponent component)
    • closestForm

      public static javax.faces.component.UIForm closestForm(javax.faces.component.UIComponent component)
    • closestUniqueIdVendor

      public static javax.faces.component.UniqueIdVendor closestUniqueIdVendor(javax.faces.component.UIComponent component)
    • closestNamingContainer

      public static javax.faces.component.UIComponent closestNamingContainer(javax.faces.component.UIComponent component)