You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by mm...@apache.org on 2007/10/24 20:18:51 UTC

svn commit: r587954 - /myfaces/core/trunk/api/src/main/java/javax/faces/render/Renderer.java

Author: mmarinschek
Date: Wed Oct 24 11:18:50 2007
New Revision: 587954

URL: http://svn.apache.org/viewvc?rev=587954&view=rev
Log:
https://issues.apache.org/jira/browse/MYFACES-1751 (MYFACES-1751): added better java-doc comments to the Renderer class, fixed (single) problem with rendering - if getRendersChildren() returns false, the component's children should be rendered one-by-one

Modified:
    myfaces/core/trunk/api/src/main/java/javax/faces/render/Renderer.java

Modified: myfaces/core/trunk/api/src/main/java/javax/faces/render/Renderer.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/java/javax/faces/render/Renderer.java?rev=587954&r1=587953&r2=587954&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/java/javax/faces/render/Renderer.java (original)
+++ myfaces/core/trunk/api/src/main/java/javax/faces/render/Renderer.java Wed Oct 24 11:18:50 2007
@@ -48,6 +48,17 @@
         if (component == null) throw new NullPointerException("component");
     }
 
+    /**Render all children if there are any.
+     * 
+     * Note: this will only be called if getRendersChildren()
+     * returns true. A component which has a renderer with
+     * getRendersChildren() set to true will typically contain
+     * the rendering logic for its children in this method.
+     * 
+     * @param context
+     * @param component
+     * @throws IOException
+     */    
     public void encodeChildren(FacesContext context,
                                UIComponent component)
             throws IOException
@@ -70,10 +81,14 @@
             {
                 child.encodeChildren(context);
             }
+            else {
+              encodeChildren(context, child);
+            }
             child.encodeEnd(context);
         }
     }
 
+    
     public void encodeEnd(FacesContext context,
                           UIComponent component)
             throws IOException
@@ -90,6 +105,21 @@
         return clientId;
     }
 
+    /**Switch for deciding who renders the children.
+     * 
+     * @return <b>true</b> - if the component takes care of rendering its
+     * children. In this case, encodeChildren() ought to be called
+     * by the rendering controller (e.g., the rendering controller
+     * could be the component's JSP-Tag). 
+     * In the method encodeChildren(), the component
+     * should therefore provide all children encode logic.
+     * <br/>
+     * <b>false</b> - if the component does not take care of rendering its
+     * children. In this case, encodeChildren() should not be called
+     * by the rendering controller. Instead, the children-list should
+     * be retrieved and the children should directly be rendered by
+     * the rendering controller one by one.
+     */    
     public boolean getRendersChildren()
     {
         return false;