UIComponent
私が提供したIDでマネージド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
ます。
「adminTabView:activityForm:activityDescription」などの絶対 ID ではなく、「activityDescription」という ID のみを持つコンポーネントを取得する方法はありますか?