JSF复合:insertFacet和复合:renderFacet

JSF复合:insertFacet和复合:renderFacet,jsf,facet,composite-component,Jsf,Facet,Composite Component,我希望有一个包含一个方面的复合组件,我在这个复合组件的“实现”中实现它。我的问题是ID,因为当我只在我的复合组件中定义,然后将我的实现放在其中时,它只呈现它,而组件位于另一个位置。 下面是一个示例代码: myComposition.xhtml <composite:implementation> <composite:renderFacet name="myFacet"> </composite:implementation> <mySomethin

我希望有一个包含一个方面的复合组件,我在这个复合组件的“实现”中实现它。我的问题是ID,因为当我只在我的复合组件中定义,然后将我的实现放在其中时,它只呈现它,而组件位于另一个位置。 下面是一个示例代码:

myComposition.xhtml

<composite:implementation>
 <composite:renderFacet name="myFacet">
</composite:implementation>
<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。

只是为了澄清:

您是否在组件的接口中指定了

此外,你在另一个地方的确切意思是什么

一些提示:

  • renderFacet是正确的,insertFacet用于复合材料本身中定义的面
  • 尝试将“”添加为facet的第一行内容,这可能是解决单行facet内容错误的一种方法

    • 我让它工作了。问题是,我必须找出插入的facet的clientId,我不知道每个复合组件都有自己的NamingContainer

      我有过这样的经历: “myComposition2.xhtml” ...

      “索引面”

      结果clientId为:myC2:myC1:

      请参见: