[jsr-314-open] Nested composite component facet insertion/rendering issue

Andy Schwartz andy.schwartz at oracle.com
Tue Sep 15 18:43:11 EDT 2009


Gang -

While looking at #{cc} expression handling, I played around with some 
simple composite components and noticed the following behavior.

If I define a composite component, foo:outer, that accepts a facet:

<composite:interface>
  <composite:facet name="caption"/>
</composite:interface>

And then use the component, specifying the facet:

                <foo:outer>
                  <f:facet name="caption">
                    <h:outputText value="Hello, Facet! (Outer)"/>
                  </f:facet>
                </foo:outer>


I find that things work as expected if I render the facet in the 
foo:outer implementation:

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


And also work just fine if I pass the facet into a Java-based 
(non-composite) component:

<composite:implementation>
  <h:panelGrid>
    <composite:insertFacet name="caption"/>
  </h:panelGrid>
</composite:implementation>


However, if I define a second component, foo:inner, that exposes the 
same facet:

<composite:interface>
  <composite:facet name="caption"/>
</composite:interface>

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

And then attempt to pass the facet into the foo:inner component from the 
foo:outer implementation:

<composite:implementation>
  <foo:inner>
    <composite:insertFacet name="caption"/>
  </foo:inner>
</composite:implementation>


My expectation is that the facet would be inserted in to the foo:inner 
composite component (via the <composite:insertFacet name="caption">) and 
then rendered by the foo:inner implementation (via the 
<composite:renderFacet name="caption">).  However, the facet do contents 
do not appear in the rendered output.

I wasn't sure whether this is a spec issue, implementation or user 
error, and have not had a chance to debug further.  Want to raise this 
here in case anyone could comment.

FWIW, this is running against the Mojarra trunk.  I have not tested 
MyFaces.  (I have attached the two composite components.)

Andy

-------------- next part --------------
A non-text attachment was scrubbed...
Name: inner.xhtml
Type: application/xhtml+xml
Size: 663 bytes
Desc: not available
Url : http://lists.jboss.org/pipermail/jsr-314-open-mirror/attachments/20090915/a2ce074a/attachment.xhtml 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: outer.xhtml
Type: application/xhtml+xml
Size: 833 bytes
Desc: not available
Url : http://lists.jboss.org/pipermail/jsr-314-open-mirror/attachments/20090915/a2ce074a/attachment-0001.xhtml 


More information about the jsr-314-open-mirror mailing list