Hey Leonardo -
Thanks for giving this a go and for sharing your findings! I am still
hopeful that we can make something along these lines work. I will try
to take a look at your patch to see if I have any ideas. (Though have
other things I need to take care of first - so may be a few days before
I get to this.)
Andy
On 5/19/10 11:15 PM, Leonardo Uribe wrote:
Hi
I tried the proposal of use some variation of TemplateClient API (I
attach it as reference on MYFACES-2638-6.patch ). The solution works
for simple cases, but it does not when nested composite components are
used.
Look this example (I removed the non relevant code):
testCompositeInsertChildren.xhtml (the page when it is used)
<testComposite:compositeInsertChildren>
<h:outputText value="GAMMA " />
</testComposite:compositeInsertChildren>
testComposite:compositeInsertChildren
<composite:implementation>
<testComposite:compositeInsertChildrenInner>
<h:outputText value="BETA " />
<composite:insertChildren />
</testComposite:compositeInsertChildrenInner>
</composite:implementation>
testComposite:compositeInsertChildrenInner
<composite:implementation>
<h:outputText value="ALFA " />
<composite:insertChildren/>
<h:outputText value="OMEGA " />
</composite:implementation>
The example should render this:
ALFA BETA GAMMA OMEGA
But it is rendered this:
ALFA GAMMA OMEGA
The current algorithm do it correctly because the tree is completely
built before relocate, so the listener relocates BETA too. Facelets
executed the inner FaceletHandler instance first and then the outer
ones. On composite components, it executes first the composite
component facelet, then the FaceletHandler children.
Suggestions are welcome.
regards,
Leonardo Uribe