javaserverfaces
  1. javaserverfaces
  2. JAVASERVERFACES-1726

Single facet gets wrapped in a UIPanel on postback

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: current
    • Fix Version/s: 2.0.4
    • Component/s: facelets
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      1,726
    • Status Whiteboard:
      Hide

      size_medium importance_large

      Show
      size_medium importance_large

      Description

      ComponentSupport.addComponent() is not handling the case of the component tree
      merge properly:
      UIComponent existing = parent.getFacets().get(facetName);
      if (existing != null) {
      if (!(existing instanceof UIPanel)) {
      // move existing component under a panel group
      UIComponent panelGroup =
      ctx.getFacesContext().getApplication().createComponent(UIPanel.COMPONENT_TYPE);
      ...

      Note that during postback with partial state saving disabled get(facetName) will
      return the existing component for the facet. The code above gets confused and
      wraps the single facet in a UIPanel.

      We could easily avoid the problem by doing the following check:
      if (existing != null && existing != child) {

      To reproduce the issue, create a page with <f:facet> containing a single
      component. Add <h:commandButton> to the page to perform postback. Disable
      partial state saving to get the component tree recreated from state. Set a
      breakpoint in ComponentSupport.addComponent() where the UIPanel gets created.
      Note that the breakpoint will be hit when the button is pressed. The expected
      result is that UIPanel is created only for cases when <f:facet> contains
      multiple components.

        Activity

        Hide
        Ed Burns added a comment -
        Show
        Ed Burns added a comment - This is intimately related to Spec issue 677. https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=677
        Hide
        Ed Burns added a comment -

        Fix checked in r8530.

        Show
        Ed Burns added a comment - Fix checked in r8530.
        Hide
        Ed Burns added a comment -

        Reopen for inclusion in 2.0.4.

        Show
        Ed Burns added a comment - Reopen for inclusion in 2.0.4.
        Hide
        Ed Burns added a comment -

        Target 2.0.4.

        Show
        Ed Burns added a comment - Target 2.0.4.
        Hide
        aschwart added a comment -

        I believe we can close this up now. It looks like the fix was backported to the MOJARRA_2_0X_ROLLING
        branch in rev 8534.

        Show
        aschwart added a comment - I believe we can close this up now. It looks like the fix was backported to the MOJARRA_2_0X_ROLLING branch in rev 8534.
        Hide
        Ed Burns added a comment -

        I am delighted to close this.

        Show
        Ed Burns added a comment - I am delighted to close this.
        Hide
        Manfred Riem added a comment -

        Closing issue out

        Show
        Manfred Riem added a comment - Closing issue out

          People

          • Assignee:
            Ed Burns
            Reporter:
            mst_70
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: