<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
No according to the documentation/implementation <f:insertFacet>
applies a facet that was defined elsewhere (i.e. from the page author)
to a child component of a composite component. In other words, it
calls:<tt><br>
<br>
<b>childcomponent.getFacets().put(name, facet)</b></tt><b>;</b><br>
<br>
If we keep that behavior, our only real option is #1:<br>
<br>
<b><tt> <composite:insertFacet name="backupCaption"
targetName="caption"/></tt>
</b><br>
<br>
Otherwise we're forced to change the behavior of what the tag does to
manipulate the "VAST" meta-data structure (which afaik doesn't yet
exist -- but perhaps can somehow be made to work reliably). This would
allow use cases where the facet is not treated as a facet, but as a way
to specify a component... which can then be passed in as a facet,
placed a child component, etc. This leads us "close" to the
functionality of "f:renderFacet"... but not quite as it doesn't add the
child (which would manipulate the id, etc.)....<br>
<br>
So, I think #2 is a very dangerous direction to go w/o putting some
thought into 1) what we're trying to solve; 2) the impact of our
solution.<br>
<br>
Ken<br>
<br>
<br>
<br>
Dan Allen wrote:
<blockquote
cite="mid:19758da0909160713ubb05023p452415da1a03ae06@mail.gmail.com"
type="cite">
<p>I suppose it depends on whether insertFacet attaches a facet to
the parent component or whether it inserts the contents of the facet
inline. I suspect the latter. In that case, you woud need to wrap
insertFacet in <f:facet>, right?</p>
<p>- Dan Allen</p>
<p>Sent from my Android-powered G1 phone:<br>
An open platform for carriers, developers<br>
and consumers.</p>
<blockquote type="cite">On Sep 15, 2009 6:43 PM, "Andy Schwartz" <<a
moz-do-not-send="true" href="mailto:andy.schwartz@oracle.com">andy.schwartz@oracle.com</a>>
wrote:<br>
<br>
Gang -<br>
<br>
While looking at #{cc} expression handling, I played around with some
simple composite components and noticed the following behavior.<br>
<br>
If I define a composite component, foo:outer, that accepts a facet:<br>
<br>
<composite:interface><br>
<composite:facet name="caption"/><br>
</composite:interface><br>
<br>
And then use the component, specifying the facet:<br>
<br>
<foo:outer><br>
<f:facet name="caption"><br>
<h:outputText value="Hello, Facet! (Outer)"/><br>
</f:facet><br>
</foo:outer><br>
<br>
<br>
I find that things work as expected if I render the facet in the
foo:outer implementation:<br>
<br>
<composite:implementation><br>
<composite:renderFacet name="caption"/><br>
</composite:implementation><br>
<br>
<br>
And also work just fine if I pass the facet into a Java-based
(non-composite) component:<br>
<br>
<composite:implementation><br>
<h:panelGrid><br>
<composite:insertFacet name="caption"/><br>
</h:panelGrid><br>
</composite:implementation><br>
<br>
<br>
However, if I define a second component, foo:inner, that exposes the
same facet:<br>
<br>
<composite:interface><br>
<composite:facet name="caption"/><br>
</composite:interface><br>
<br>
<composite:implementation><br>
<composite:renderFacet name="caption"/><br>
</composite:implementation><br>
<br>
And then attempt to pass the facet into the foo:inner component from
the foo:outer implementation:<br>
<br>
<composite:implementation><br>
<foo:inner><br>
<composite:insertFacet name="caption"/><br>
</foo:inner><br>
</composite:implementation><br>
<br>
<br>
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.<br>
<br>
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.<br>
<br>
FWIW, this is running against the Mojarra trunk. I have not tested
MyFaces. (I have attached the two composite components.)<br>
<font color="#888888"><br>
Andy<br>
<br>
</font></blockquote>
</blockquote>
</body>
</html>