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

Ed Burns Ed.Burns at Sun.COM
Wed Sep 16 14:17:37 EDT 2009


>>>>> On Wed, 16 Sep 2009 10:13:36 -0400, Dan Allen <dan.j.allen at gmail.com> said:

DA> I suppose it depends on whether insertFacet attaches a facet to the parent
DA> component or whether it inserts the contents of the facet inline. I suspect
DA> the latter. In that case, you woud need to wrap insertFacet in <f:facet>,
DA> right?

<cc:insertFacet>

  The presence of this tag in a <composite:implementation> section must
  cause the named facet to be taken from the facet map of the top level
  component and inserted as a facet child of the component in which this
  element is nested.

javax.faces.CompositeFacet

  encodeBegin() and encodeEnd() must take no action for this
  renderer. Due to the specification of the <composite:insertChildren>
  tag handler, the component passed to the encodeChildern() method of
  this renderer will be the component with component-family
  javax.faces.Output and renderer-type equal to the one for this
  renderer. The implementation of encodeBegin(), must obtain the
  component attribute value under the key given by the value of the
  symbolic constant UIComponent.FACETS_KEY from the attributes map of
  the argument component. If not found, throw IOException. This value is
  referred to as "facetName" for discission. Find the closest ancestor
  composite component in which the argument component is nested. If no
  such component can be found, thow IOException. Otherwise, get the
  facet whose name is "facetName". If found call encodeAll() on the
  facet.

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

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

AS> <composite:implementation>
AS>   <composite:renderFacet name="caption"/>
line B^^^^^^^^^^^^^^^^^^

AS> </composite:implementation>

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

AS> <composite:implementation>
AS>   <foo:inner>
AS>     <composite:insertFacet name="caption"/>
line A^^^^^^^^^^^^^^^^^^

AS>   </foo:inner>
AS> </composite:implementation>

1. when the using page executes, the children <f:facet name="caption">
  are placed in the facet map of the top level component for foo:outer.

2. when the insertFacet on line A executes, the children are moved from
  being facet children of the top level component for foo:outer to being
  facet children of the top level component for foo:inner

3. when the renderFacet on line B executes, according to the spec, it
  should find the facet and render it.  

It looks to me like an impl bug.

Can you file it?

Ed

[1] http://java.sun.com/javaee/javaserverfaces/2.0/docs/pdldocs/facelets/composite/insertFacet.html

[2] http://java.sun.com/javaee/javaserverfaces/2.0/docs/renderkitdocs/HTML_BASIC/javax.faces.Outputjavax.faces.CompositeFacet.html

-- 
| ed.burns at sun.com  | office: 408 884 9519 OR x31640
| homepage:         | http://ridingthecrest.com/




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