[JAVASERVERFACES-2957] Tree creation is broken when using <cc:insertChildren> directly in <cc:implementation> Created: 22/Jul/13  Updated: 25/Jul/13  Resolved: 25/Jul/13

Status: Closed
Project: javaserverfaces
Component/s: composite components, facelets
Affects Version/s: 2.0.3, 2.0.4, 2.1.0, 2.1.1
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Eugene Burtsev Assignee: Unassigned
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Zip Archive ccState_v3.zip    
Issue Links:
Dependency
depends on JAVASERVERFACES-2040 Partial state saving broken for compo... Closed
depends on JAVASERVERFACES_SPEC_PUBLIC-1125 Clarify that SystemEvent and Componen... Closed
Duplicate
is duplicated by JAVASERVERFACES-1680 Re-creation of composite component ch... Closed
Related
is related to JAVASERVERFACES-2839 composite component umbrella task Closed
Tags: composite_components

 Description   

While analyzing the state issue JAVASERVERFACES-2040 I found out that the tree creation is broken on postback when using <cc:insertChildren> directly in <cc:implementation>.

The relevant composite components will look like this:
<cc:implementation>
<cc:insertChildren />
</cc:implementation>

What will happen on postback:
1.) The view will be created fine in restoreView phase. This includes the invocation of com.sun.faces.facelets.tag.composite.InsertChildrenHandler.RelocateChildrenListener that will move the childs of the composite component (UINamingContainer) to the implicit panel of the composite component implementation.

2.) In renderView phase the facelets tree is applied a second time. But this time com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.ComponentTagHandlerDelegateImpl will not find the already existing childs of the composite component because they were relocated. The relevant method com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.findReparentedComponent() will never be called in this case.
As a result new child components will be created (with invalid state).

If insertChildren is nested inside a component the relocating code will work as expected. The working components will look like this:
<cc:implementation>
<someRealUIComponent>
<cc:insertChildren />
</someRealUIComponent>
</cc:implementation>



 Comments   
Comment by Eugene Burtsev [ 22/Jul/13 ]

This issue is clone of https://java.net/jira/browse/JAVASERVERFACES-2053.

I've reproduced this issue in latest 2.1.24 and 2.2.1 versions.

Code like following doesn't work too:

<composite:implementation>
<div>
<composite:insertChildren/>
</div>
</composite:implementation>

Comment by Manfred Riem [ 25/Jul/13 ]

I cannot reproduce this issue.

Generated at Thu Sep 03 11:30:33 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.