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