Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
$URL: https://source.sakaiproject.org/svn/jsf/tags/sakai-10.0/jsf-widgets/src/java/org/sakaiproject/jsf/renderer/DynaRendererBase.java $ $Id: DynaRendererBase.java 105077 2012-02-24 22:54:29Z ottenhoff@longsight.com $ Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008 The Sakai Foundation Licensed under the Educational Community License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.opensource.org/licenses/ECL-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. /
 
 
 package org.sakaiproject.jsf.renderer;
 
 
 
 
 public abstract class DynaRendererBase
     extends Renderer {
 
   public DynaRendererBase() {
     super();
   }
 
   abstract public void encodeBegin(FacesContext context,
           UIComponent componentthrows IOException;
   abstract public void encodeEnd(FacesContext context,
            UIComponent componentthrows IOException;

  

Faces render output method .

Encode children column and multicolumn

Parameters:
context FacesContext for the current request
component UIComponent being rendered
Throws:
java.io.IOException if an input/output error occurs
 
  public void encodeChildren(FacesContext contextUIComponent componentthrows
  {
    if (!component.isRendered())
    {
      return;
    }
 
    renderData(contextcomponent);
  }

  
This component renders its children

Returns:
true
 
   public boolean getRendersChildren()
   {
     return true;
   }

  
This is an UIData type component.

Parameters:
component
Returns:
true if UIData
 
   public boolean supportsComponentType(UIComponent component)
   {
     return (component instanceof UIData);
   }



  
Core workhouse method of the dynamic renderers.

Parameters:
context FacesContext
component UIComponent
Throws:
java.io.IOException
 
   protected void renderData(FacesContext contextUIComponent componentthrows
     IOException
   {
     boolean multiColumn = component instanceof MultiColumnComponent;
    ResponseWriter writer = context.getResponseWriter();
    UIData data = (UIDatacomponent;
    int first = data.getFirst();
    int rows = data.getRows();
    for (int i = firstn = 0; n < rowsi++, n++)
    {
      data.setRowIndex(i);
      if (!data.isRowAvailable())
      {
        break;
      }
      ////////////////////////////////////
      //  TR
      ////////////////////////////////////
      writer.startElement("tr"data);
      Iterator iter = data.getChildren().iterator();
      while (iter.hasNext())
      {
        UIComponent child = (UIComponentiter.next();
        if (child instanceof UIColumn)
        {
          writer.startElement("td"child);
          writer.write("debug UIColumn");
          RendererUtil.encodeRecursive(contextchild);
          writer.endElement("td");
        }
        else if (child instanceof UIData)
        {
          writer.write("debug UIData");
          child.encodeBegin(context);
          child.encodeChildren(context);
          child.encodeEnd(context);
        }
      }
      ////////////////////////////////////
      //  /TR
      ////////////////////////////////////
      writer.endElement("tr");
      writer.write("\n");
    }
  }
New to GrepCode? Check out our FAQ X