javaserverfaces
  1. javaserverfaces
  2. JAVASERVERFACES-2957

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

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Cannot Reproduce
    • 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

          Eugene Burtsev created issue -
          Eugene Burtsev made changes -
          Field Original Value New Value
          Link This issue is duplicated by JAVASERVERFACES-1680 [ JAVASERVERFACES-1680 ]
          Eugene Burtsev made changes -
          Link This issue is related to JAVASERVERFACES-2839 [ JAVASERVERFACES-2839 ]
          Eugene Burtsev made changes -
          Link This issue depends on JAVASERVERFACES-2040 [ JAVASERVERFACES-2040 ]
          Eugene Burtsev made changes -
          Manfred Riem made changes -
          Summary CLONE -Tree creation is broken when using <cc:insertChildren> directly in <cc:implementation> Tree creation is broken when using <cc:insertChildren> directly in <cc:implementation>
          Manfred Riem made changes -
          Priority Trivial [ 5 ] Major [ 3 ]
          Manfred Riem made changes -
          Status Open [ 1 ] Closed [ 6 ]
          Resolution Cannot Reproduce [ 5 ]

            People

            • Assignee:
              Unassigned
              Reporter:
              Eugene Burtsev
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: