/** * <p>Create a new child component using <code>createComponent</code>, * initialize its properties, and add it to its parent as a child. * </p> * @param context {@link FacesContext} for the current request * @param parent Parent {@link UIComponent} for the new child * @param componentId Component identifier for the new child, * or <code>null</code> for no explicit identifier */ private UIComponent createChild(FacesContext context, UIComponent parent, String componentId) throws JspException { UIComponent component = createComponent(context, componentId); UIComponentTagBase parentTag = getParentUIComponentClassicTagBase(pageContext); int indexOfNextChildTag = parentTag.getIndexOfNextChildTag(); if (indexOfNextChildTag > parent.getChildCount()) { indexOfNextChildTag = parent.getChildCount(); } parent.getChildren().add(indexOfNextChildTag, component); created = true; return (component); }