javaserverfaces
  1. javaserverfaces
  2. JAVASERVERFACES-128

UIData does not restoreDescendantState for descendant facets

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 1.1_01
    • Fix Version/s: 1.2
    • Component/s: None
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      128

      Description

      I'm not sure if this is a defect in the API or the RI.

      In UIData, restoreDescendantState has the job of reseting the client ids of all
      descendants of the columns of the data table.
      The problem is that the code only iterates recurisvely through the children
      list, and ignores facets.
      I have a component where command links can be put in a facet, which are then
      rendered. Because the client id of the command link is not reset, the command
      link fires for every row in the table.

      A simple fix:

      protected void restoreDescendantStateEx(UIComponent component,
      FacesContext context) {

      // Reset the client identifier for this component
      String id = component.getId();
      component.setId(id); // Forces client id to be reset

      // Restore state for children of this component
      if (component.getChildCount()>0)
      {
      Iterator kids = component.getChildren().iterator();
      while (kids.hasNext())

      { restoreDescendantState((UIComponent) kids.next(), context); }

      }
      Iterator facetNames = component.getFacets().keySet().iterator();
      while (facetNames.hasNext())

      { UIComponent c = component.getFacet( (String) facetNames.next() ); if (c!=null) restoreDescendantState(c, context); }

      }

        Activity

        Hide
        jnermut added a comment -

        set target to 1.2

        Show
        jnermut added a comment - set target to 1.2
        Hide
        jayashri added a comment -

        Can you please review the patch ?

        Show
        jayashri added a comment - Can you please review the patch ?
        Hide
        Ed Burns added a comment -

        Currently testing the patch.

        Show
        Ed Burns added a comment - Currently testing the patch.
        Hide
        Ed Burns added a comment -

        The change also needs to be made to the saveDescendantState().

        Show
        Ed Burns added a comment - The change also needs to be made to the saveDescendantState().
        Hide
        Ed Burns added a comment -

        Fix checked in.

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

        fixed

        Show
        Ed Burns added a comment - fixed
        Hide
        Manfred Riem added a comment -

        Closing issue out

        Show
        Manfred Riem added a comment - Closing issue out

          People

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

            Dates

            • Created:
              Updated:
              Resolved: