Author: akushunin
Date: 2008-01-06 10:07:25 -0500 (Sun, 06 Jan 2008)
New Revision: 5158
Modified:
trunk/ui/toolBar/src/main/java/org/richfaces/renderkit/html/ToolBarGroupRenderer.java
Log:
RF-1825
Modified:
trunk/ui/toolBar/src/main/java/org/richfaces/renderkit/html/ToolBarGroupRenderer.java
===================================================================
---
trunk/ui/toolBar/src/main/java/org/richfaces/renderkit/html/ToolBarGroupRenderer.java 2008-01-06
11:44:26 UTC (rev 5157)
+++
trunk/ui/toolBar/src/main/java/org/richfaces/renderkit/html/ToolBarGroupRenderer.java 2008-01-06
15:07:25 UTC (rev 5158)
@@ -24,6 +24,7 @@
import java.io.IOException;
import java.util.Iterator;
+import java.util.List;
import javax.faces.FacesException;
import javax.faces.component.UIComponent;
@@ -31,7 +32,6 @@
import javax.faces.context.ResponseWriter;
import org.ajax4jsf.renderkit.RendererBase;
-
import org.richfaces.component.UIToolBarGroup;
import org.richfaces.renderkit.html.images.DotSeparatorImage;
import org.richfaces.renderkit.html.images.GridSeparatorImage;
@@ -59,18 +59,26 @@
String contentStyle = (String)
toolBarGroup.getToolBar().getAttributes().get("contentStyle");
if (component.getChildCount() > 0) {
- for (Iterator it = component.getChildren().iterator(); it.hasNext();) {
+ List children = component.getChildren();
+ for (Iterator iter = children.iterator(); iter.hasNext();) {
+ UIComponent child = (UIComponent) iter.next();
+ if(!child.isRendered()){
+ iter.remove();
+ }
+ }
+ for (Iterator it = children.iterator(); it.hasNext();) {
UIComponent child = (UIComponent) it.next();
- writer.startElement("td", component);
- writer.writeAttribute("class", "dr-toolbar-int rich-toolbar-item
" + contentClass +" "+styleClass, null);
- getUtils().writeAttribute(writer, "style", contentStyle);
- getUtils().writeAttribute(writer, "style", style);
- getUtils().encodePassThruWithExclusions(facesContext, component,
"style,class");
- renderChild(facesContext, child);
- writer.endElement("td");
- if (it.hasNext()) {
- insertSeparatorIfNeed(writer, facesContext, toolBarGroup);
- }
+ writer.startElement("td", component);
+ writer.writeAttribute("class", "dr-toolbar-int rich-toolbar-item
" + contentClass +" "+styleClass, null);
+ getUtils().writeAttribute(writer, "style", contentStyle);
+ getUtils().writeAttribute(writer, "style", style);
+ getUtils().encodePassThruWithExclusions(facesContext, component,
"style,class");
+ renderChild(facesContext, child);
+ writer.endElement("td");
+ if (it.hasNext()) {
+ insertSeparatorIfNeed(writer, facesContext, toolBarGroup);
+ }
+
}
}
}
Show replies by date