@Deprecated public static String findComponentClientId(String id) { FacesContext facesContext = FacesContext.getCurrentInstance(); UIComponent component = ComponentTraversalUtils.firstWithId(id, facesContext.getViewRoot()); return component.getClientId(facesContext); }
@Override public UIComponent resolveComponent(FacesContext context, UIComponent source, UIComponent last, String expression, int options) { return ComponentTraversalUtils.firstWithId(extractId(expression), last); }
/** * Finds the first component with the given id (NOT clientId!). * * @param id The id. * @param base The base component to start the traversal. * @return The component or null. */ public static UIComponent firstWithId(String id, UIComponent base) { if (id.equals(base.getId())) { return base; } UIComponent result = null; Iterator<UIComponent> kids = base.getFacetsAndChildren(); while (kids.hasNext() && (result == null)) { UIComponent kid = kids.next(); if (id.equals(kid.getId())) { result = kid; break; } result = firstWithId(id, kid); if (result != null) { break; } } return result; }
public static boolean existsComponentId(String id) { FacesContext facesContext = FacesContext.getCurrentInstance(); UIComponent component = ComponentTraversalUtils.firstWithId(id, facesContext.getViewRoot()); return component != null; }
@Deprecated public static String findComponentClientId(String id) { FacesContext facesContext = FacesContext.getCurrentInstance(); UIComponent component = ComponentTraversalUtils.firstWithId(id, facesContext.getViewRoot()); return component.getClientId(facesContext); }
public static String findComponentClientId(String id) { FacesContext facesContext = FacesContext.getCurrentInstance(); UIComponent component = ComponentTraversalUtils.firstWithId(id, facesContext.getViewRoot()); return component.getClientId(facesContext); }
/** * Finds the first component with the given id (NOT clientId!). * * @param id The id. * @param base The base component to start the traversal. * @return The component or null. */ public static UIComponent firstWithId(String id, UIComponent base) { if (id.equals(base.getId())) { return base; } UIComponent result = null; Iterator<UIComponent> kids = base.getFacetsAndChildren(); while (kids.hasNext() && (result == null)) { UIComponent kid = (UIComponent) kids.next(); if (id.equals(kid.getId())) { result = kid; break; } result = firstWithId(id, kid); if (result != null) { break; } } return result; }