3

I want to have a composite component with a facet in it, which I implement in my "implementation" of this composite component. My problem are ids, because when I only define in my composite component and then with put my implementation in it, it only renders it but the component is in another place. Here is a sample code:

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>

What can I do about this? With composite:insertFacet it doesn't render anything. I need to have the component also there because I need to know the client id of it.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Null
  • 31
  • 1
  • 3
  • See: http://stackoverflow.com/questions/7891650/using-compositeinsertfacet-renderfacet-does-not-work-inside-tdatatable/9091313#9091313 – Lenik Feb 01 '12 at 05:49

2 Answers2

2

Just to clarify:

Did you specify <cc:facet name="myFacet"> within the interface of the component?

Furthermore what exactly do you mean with in another place?

Some tips:

  • renderFacet is correct, insertFacet is for facets defined within the composite itself.
  • Try adding "<!-- -->" as the first line of content of your facet, this suppose to be a workaround for a bug regarding single line facet content.
Robbert
  • 335
  • 2
  • 5
0

I got it working. The problem was I had to figure out the clientId of the facet inserted and I didn't know that each composite-component makes it own NamingContainer.

I had something like that: "myComposition2.xhtml" ...

"index.faces"

and the resulting clientId was: myC2:myC1: