2011-03-10 59 views
3

我想要一個複合組件,其中包含一個構面,我在這個複合組件的「實現」中實現它。我的問題是IDS,因爲當我只在我的複合組件中定義,然後把它放到我的實現中時,它只會渲染它,但組件在另一個位置。 下面是一個示例代碼:JSF複合:insertFacet和複合:renderFacet

myComposition.xhtml

<composite:implementation> 
<composite:renderFacet name="myFacet"> 
</composite:implementation> 

myCompositionImpl.xhtml

<mySomething:myComposition> 
<f:facet name="myFacet"> 
    this code is rendered but the "component" which I define here is not placed 
    logically in the place where I defined the "renderFacet". 
</f:facet> 
</mySomething:myComposition> 

我能做些什麼呢?使用composite:insertFacet它不會呈現任何東西。我需要組件也在那裏,因爲我需要知道它的客戶端ID。

+0

參見:http://stackoverflow.com/questions/7891650/using-compositeinsertfacet-renderfacet-does-not-work-inside-tdatatable/9091313#9091313 – 2012-02-01 05:49:24

回答

2

只是爲了澄清:

你指定< CC:小NAME = 「myFacet」>組件的界面內?

此外,你在另一個地方的意思是什麼?

一些提示:

  • renderFacet是正確的,是insertFacet用於複合本身內定義刻面。
  • 嘗試添加「<! - - >」作爲您的方面的第一行內容,這應該是針對有關單行方面內容的錯誤的解決方法。
0

我明白了。問題是我不得不弄清插入的faceI的clientId,我不知道每個複合組件都使它擁有NamingContainer。

我有這樣的事情: 「myComposition2.xhtml」 ...

「index.faces」

,並將所得的clientId是:MYC2:myC1: