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

          Hide
          Manfred Riem added a comment -

          I cannot reproduce this issue.

          Show
          Manfred Riem added a comment - I cannot reproduce this issue.
          Hide
          Eugene Burtsev added a comment -

          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>

          Show
          Eugene Burtsev added a comment - 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>

            People

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

              Dates

              • Created:
                Updated:
                Resolved: