You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ma...@apache.org on 2005/03/07 19:39:04 UTC

cvs commit: incubator-myfaces/src/components/org/apache/myfaces/custom/tree2 HtmlTreeRenderer.java HtmlTree.java

matzew      2005/03/07 10:39:04

  Modified:    src/components/org/apache/myfaces/custom/tree2
                        HtmlTreeRenderer.java HtmlTree.java
  Log:
  Patch for the new tree form Sean Schofield (MYFACES-119)
  
  Revision  Changes    Path
  1.10      +5 -5      incubator-myfaces/src/components/org/apache/myfaces/custom/tree2/HtmlTreeRenderer.java
  
  Index: HtmlTreeRenderer.java
  ===================================================================
  RCS file: /home/cvs/incubator-myfaces/src/components/org/apache/myfaces/custom/tree2/HtmlTreeRenderer.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- HtmlTreeRenderer.java	7 Mar 2005 16:17:19 -0000	1.9
  +++ HtmlTreeRenderer.java	7 Mar 2005 18:39:04 -0000	1.10
  @@ -468,6 +468,7 @@
   
           // add the appropriate image for the nav control
           UIGraphic image = new UIGraphic();
  +        image.setId(context.getViewRoot().createUniqueId());
           image.setUrl(navSrcUrl);
           Map imageAttrs = image.getAttributes();
           imageAttrs.put(HTML.WIDTH_ATTR, "19");
  @@ -491,7 +492,7 @@
                   expandImgSrc = expandImg.getUrl();
                   if (expandImg.isRendered())
                   {
  -                    expandImg.setId(null);
  +                    expandImg.setId(context.getViewRoot().createUniqueId());
                       nodeImageId = expandImg.getClientId(context);
                       nodeImgFacet = expandFacet;
                   }
  @@ -504,7 +505,7 @@
                   collapseImgSrc = collapseImg.getUrl();
                   if (collapseImg.isRendered())
                   {
  -                    collapseImg.setId(null);
  +                    collapseImg.setId(context.getViewRoot().createUniqueId());
                       nodeImageId = collapseImg.getClientId(context);
                       nodeImgFacet = collapseFacet;
                   }
  @@ -543,6 +544,7 @@
           {
               // set up the expand control and remove whatever children (if any) this control had previously
               UICommand expandControl = tree.getExpandControl();
  +            expandControl.setId(context.getViewRoot().createUniqueId());
               expandControl.getChildren().clear();
   
               UIParameter param = new UIParameter();
  @@ -551,8 +553,6 @@
               expandControl.getChildren().add(param);
               expandControl.getChildren().add(image);
   
  -            tree.getChildren().add(expandControl);
  -
               encodeRecursive(context, expandControl);
           }
           out.endElement(HTML.TD_ELEM);
  
  
  
  1.5       +5 -4      incubator-myfaces/src/components/org/apache/myfaces/custom/tree2/HtmlTree.java
  
  Index: HtmlTree.java
  ===================================================================
  RCS file: /home/cvs/incubator-myfaces/src/components/org/apache/myfaces/custom/tree2/HtmlTree.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- HtmlTree.java	26 Feb 2005 00:26:00 -0000	1.4
  +++ HtmlTree.java	7 Mar 2005 18:39:04 -0000	1.5
  @@ -81,8 +81,9 @@
       }
   
       /**
  -     * Gets the expand/collapse control that can be used to handle expand/collapse actions.  This methods supports
  -     * renderers that are supplying client-side toggling functionality.
  +     * Gets the expand/collapse control that can be used to handle expand/collapse nodes.  This is only used in server-side 
  +     * mode.  It allows the nagivation controls (if any) to be clickable as well as any commandLinks the user has set up in 
  +     * their JSP.
        *
        * @return UICommand
        */
  @@ -135,4 +136,4 @@
               super.processChildNodes(context, parentNode, processAction);
           }
       }
  -}
  \ No newline at end of file
  +}