You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2010/08/19 22:40:05 UTC

svn commit: r987302 - /myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/datascroller/HtmlDataScrollerRenderer.java

Author: lu4242
Date: Thu Aug 19 20:40:05 2010
New Revision: 987302

URL: http://svn.apache.org/viewvc?rev=987302&view=rev
Log:
TOMAHAWK-1463 Data Scroller renders the paginator twice. (Thanks to Marek Hawrylczak for this patch)

Modified:
    myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/datascroller/HtmlDataScrollerRenderer.java

Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/datascroller/HtmlDataScrollerRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/datascroller/HtmlDataScrollerRenderer.java?rev=987302&r1=987301&r2=987302&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/datascroller/HtmlDataScrollerRenderer.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/datascroller/HtmlDataScrollerRenderer.java Thu Aug 19 20:40:05 2010
@@ -193,7 +193,23 @@ public class HtmlDataScrollerRenderer ex
     {
         RendererUtils.checkParamValidity(facescontext, uicomponent, HtmlDataScroller.class);
 
-        RendererUtils.renderChildren(facescontext, uicomponent);
+        // TOMAHAWK-1463 Don't render paginator links twice!
+        if (uicomponent.getChildCount() > 0)
+        {
+            HtmlDataScroller scroller = (HtmlDataScroller) uicomponent;
+            String scrollerIdPagePrefix = scroller.getId() + HtmlDataScrollerRenderer.PAGE_NAVIGATION;
+
+            for (Iterator it = uicomponent.getChildren().iterator(); it.hasNext(); )
+            {
+                UIComponent child = (UIComponent)it.next();
+                String childId = child.getId();
+
+                if (childId != null && !childId.startsWith(scrollerIdPagePrefix))
+                {
+                    RendererUtils.renderChild(facescontext, child);
+                }
+            }
+        }
     }
 
     public void encodeEnd(FacesContext facesContext, UIComponent uiComponent) throws IOException