Author: abelevich
Date: 2007-05-04 09:52:02 -0400 (Fri, 04 May 2007)
New Revision: 648
Modified:
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ScrollableGridBaseRenderer.java
Log:
Modified:
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ScrollableGridBaseRenderer.java
===================================================================
---
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ScrollableGridBaseRenderer.java 2007-05-04
13:51:50 UTC (rev 647)
+++
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ScrollableGridBaseRenderer.java 2007-05-04
13:52:02 UTC (rev 648)
@@ -6,6 +6,7 @@
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
+import org.ajax4jsf.framework.ajax.AjaxContext;
import org.ajax4jsf.framework.renderer.RendererUtils.HTML;
import org.richfaces.component.UIScrollableGrid;
import org.richfaces.renderkit.CompositeRenderer;
@@ -27,6 +28,7 @@
public void visit(FacesContext context, UIComponent component, ResponseWriter writer)
throws IOException {
writer.startElement(HTML.td_ELEM, component);
+ getUtils().writeAttribute(writer, "frozen",
component.getAttributes().get("frozen"));
writer.writeText("\n", null);
if(component.getFacet(HEADER_PART) != null){
@@ -41,13 +43,16 @@
private final ColumnVisitor footerRenderer = new ColumnVisitor(){
public void visit(FacesContext context, UIComponent component, ResponseWriter writer)
throws IOException {
+
writer.startElement(HTML.td_ELEM, component);
+ getUtils().writeAttribute(writer,
"style",component.getAttributes().get("style"));
writer.writeText("\n", null);
if(component.getFacet(FOOTER_PART) != null){
- component = component.getFacet(HEADER_PART);
+ component = component.getFacet(FOOTER_PART);
renderChild(context, component);
}
+
writer.endElement(HTML.td_ELEM);
writer.writeText("\n", null);
}
@@ -91,4 +96,47 @@
ResponseWriter writer = context.getResponseWriter();
ColumnWalker.iterateOverKids(context, component, footerRenderer, writer);
}
+
+// for benchmark
+ public void encodeBegin(FacesContext context, UIComponent component) throws IOException
{
+
+ if(AjaxContext.getCurrentInstance().isAjaxRequest()){
+ }else{
+ super.encodeBegin(context, component);
+ }
+ }
+
+ public void encodeEnd(FacesContext context, UIComponent component) throws IOException {
+
+ if(AjaxContext.getCurrentInstance().isAjaxRequest()){
+ }else{
+ super.encodeEnd(context, component);
+ }
+ }
+
+ public void encodeChildren(FacesContext context, UIComponent component) throws
IOException {
+
+ ResponseWriter writer = context.getResponseWriter();
+
+ AjaxContext ajaxContext = AjaxContext.getCurrentInstance();
+ if(ajaxContext.isAjaxRequest()){
+ writer.startElement("div", component);
+ for (int i = 0; i < 100; i++) {
+ for (int j = 0; j < 18; j++) {
+ writer.startElement("span", component);
+
+ String id = "bc_" + i + "_" + j;
+ getUtils().writeAttribute(writer,"id", id);
+ writer.writeText(i + ":" + j + " test" + i, null);
+ writer.endElement("span");
+ ajaxContext.addRenderedArea(id);
+ }
+
+ }
+ writer.endElement("div");
+
+ }else{
+ super.encodeChildren(context, component);
+ }
+ }
}
Show replies by date