Я хочу найти UIComponent
из управляемого bean идентификатором, который я предоставил.
Я написал следующий код:
private UIComponent getUIComponent(String id) {
return FacesContext.getCurrentInstance().getViewRoot().findComponent(id) ;
}
Я определил a p:inputTextarea
как:
<p:inputTextarea id="activityDescription" value="#{adminController.activityDTO.activityDescription}" required="true" maxlength="120"
autoResize="true" counter="counter" counterTemplate="{0} characters remaining." cols="80" rows="2" />
Теперь, если вызов метода как getUIComponent("activityDescription")
возвращает null
, но если я назову его getUIComponent("adminTabView:activityForm:activityDescription")
, я могу получить экземпляр org.primefaces.component.inputtextarea.InputTextarea
.
Есть ли способ получить компонент только с идентификатором i.e, "activityDescription", а не с абсолютным id, то есть "adminTabView: activityForm: activityDescription"?