javaserverfaces
  1. javaserverfaces
  2. JAVASERVERFACES-2053

Tree creation is broken when using <cc:insertChildren> directly in <cc:implementation>

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Incomplete
    • Affects Version/s: 2.0.3, 2.0.4, 2.1.0, 2.1.1
    • Fix Version/s: None
    • Labels:
      None

      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>

        Issue Links

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              Mathias Werlitz
            • Votes:
              9 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: