![](/img/trans.png)
[英]javax.faces.FacesException: Cannot find slider target component 'txt6; txt7' in view
[英]Composite component javax.faces.FacesException: Cannot find component “inputID” in view
我有一個復合組件,當在頁面中一次使用時,效果很好,但是如果我多次使用它,則無法正常工作。 假設該組件稱為my:field:
<composite:implementation>
<h:form id="myForm" prependId="false">
<p:message for="inputID" display="text"/>
<p:inputText binding="#{myBean.valueBind}" id="inputID" value="#{myBean.value}" required="true" />
<p:commandButton process="@form" update="@form" action="#myBean.action} value="Do something" ajax="true"/>
</h:form>
</composite:implementation>
我這樣使用它:
<my:field id="field1"/>
效果很好,但是如果我在下面添加它:
<my:field id="field2"/>
我收到以下異常javax.faces.FacesException: Cannot find component "inputID" in view.
我不明白我在做什么錯? 我已經嘗試使用cc.attr.id
在表單ID,組件ID(field1)之前添加cc.attr.id
。 我只是不知道該怎么辦。
我正在使用mojarra 2.1.13和primefaces 3.5。 任何幫助將不勝感激。
謝謝。
編輯:我向我的p:inputText
添加binding=....
屬性,因為這是導致問題的原因,但我在最初的帖子中已將其省略。
原來是binding
屬性。 刪除它會使事情正常進行,我將需要使該字段無效的另一種方法。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.