Java Code Examples for javax.faces.component.UIComponent.getRendersChildren()

The following are Jave code examples for showing how to use getRendersChildren() of the javax.faces.component.UIComponent class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: myfaces-trinidad   File: UIComponentUINode.java   View Source Code Vote up 6 votes
@SuppressWarnings("unchecked")
private void _renderComponent(FacesContext context, UIComponent component)
  throws IOException
{
  component.encodeBegin(context);
  if (component.getRendersChildren())
  {
    component.encodeChildren(context);
  }
  else
  {
    int count = component.getChildCount();
    if (count > 0)
    {
      List<UIComponent> children = component.getChildren();
      for (int i = 0; i < count; i++)
      {
        UIComponent child = children.get(i);
        if (child.isRendered())
          _renderComponent(context, child);
      }
    }
  }

  component.encodeEnd(context);
}
 
Example 2
Project: myfaces-trinidad   File: FacesTestCase.java   View Source Code Vote up 6 votes
/**
 * Renders the component tree.
 *
 * @param context    the faces context
 * @param component  the component tree to render
 *
 * @throws IOException  when the render fails
 */
@SuppressWarnings("unchecked")
protected void doRenderResponse(
  FacesContext context,
  UIComponent  component) throws IOException
{
  component.encodeBegin(context);
  if (component.getRendersChildren())
  {
    component.encodeChildren(context);
  }
  else
  {
    for(UIComponent child : (List<UIComponent>)component.getChildren())
    {
      doRenderResponse(context, child);
    }
  }
  component.encodeEnd(context);
}
 
Example 3
Project: myfaces-trinidad   File: RenderUtils.java   View Source Code Vote up 5 votes
/**
 * Encodes a component and all of its children.
 */
@SuppressWarnings("unchecked")
static public void encodeRecursive(FacesContext context,
                                   UIComponent component)
  throws IOException
{
  if (component.isRendered())
  {
    component.encodeBegin(context);
    if (component.getRendersChildren())
    {
      component.encodeChildren(context);
    }
    else
    {
      if (component.getChildCount() > 0)
      {
        for(UIComponent child : (List<UIComponent>)component.getChildren())
        {
          encodeRecursive(context, child);
        }
      }
    }

    component.encodeEnd(context);
  }
}