I tried to do in a ManagedBean
:
UIComponent a = FacesContext.getCurrentInstance().getViewRoot().findComponent("a:b");
I checked with the chrome browser inspector, and the component has id "a:b". But debugging the code, I get the UIComponent
equal to null
.
I tried with all the combinations: ":a:b", ":b", "b", "\\:a\\:b"...
I'm using Primefaces 3.4.1 with Mojarra 2.1.7
UPDATE: I also tried as suggested in the comments:
UIComponent container = FacesContext.getCurrentInstance().getViewRoot().findComponent("a");
UIComponent b = ((UIComponentBase) container).findComponent("b");
container
is not null
, but b
is null