Java Code Examples for javax.faces.component.UIComponent.encodeChildren()
The following are Jave code examples for showing how to use
encodeChildren() 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 | 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: DateFieldAsRenderer.java View Source Code | 6 votes |
@Override public void encodeChildren(FacesContext context, UIComponent component) throws IOException { ResponseWriter out = context.getResponseWriter(); UIComponent month = component.getFacet("month"); month.encodeBegin(context); month.encodeChildren(context); month.encodeEnd(context); out.writeText("\u00a0/\u00a0", null); UIComponent day = component.getFacet("day"); day.encodeBegin(context); day.encodeChildren(context); day.encodeEnd(context); out.writeText("\u00a0/\u00a0", null); UIComponent year = component.getFacet("year"); year.encodeBegin(context); year.encodeChildren(context); year.encodeEnd(context); }
Example 3
Project: myfaces-trinidad File: FacesTestCase.java View Source Code | 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 4
Project: myfaces-trinidad File: DateField.java View Source Code | 5 votes |
@SuppressWarnings("unchecked") @Override public void encodeChildren(FacesContext context) throws IOException { for(UIComponent child : (List<UIComponent>)getChildren()) { assert(child.getChildCount() == 0); assert(child.getFacets().isEmpty()); child.encodeBegin(context); child.encodeChildren(context); child.encodeEnd(context); } }
Example 5
Project: myfaces-trinidad File: RenderUtils.java View Source Code | 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); } }