Refine search
void addChildToComponentAndTag(UIComponent child) { UIComponent myComponent = this.getComponentInstance(); int indexOfNextChildTag = this.getIndexOfNextChildTag(); if (indexOfNextChildTag > myComponent.getChildCount()) { indexOfNextChildTag = myComponent.getChildCount(); } myComponent.getChildren().add(indexOfNextChildTag, child); this.addChild(child); }
@Override public boolean getCreated() { return target.getCreated(); }
public int doEndTag() throws JspException popTag(); UIComponent component = getComponentInstance(); removeFormerChildren(component); removeFormerFacets(component); UIComponentClassicTagBase parentTag = getParentUIComponentClassicTagBase(pageContext); UIComponent verbatimComp = createVerbatimComponentFromBodyContent(); component.getChildren().add(verbatimComp); parentTag.addChild(verbatimComp); throw new JspException(e); int retValue = getDoEndValue(); internalRelease();
/** * <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, UIComponentClassicTagBase parentTag, String componentId) throws JspException { UIComponent component = createComponent(context, componentId); int indexOfNextChildTag = parentTag.getIndexOfNextChildTag(); if (indexOfNextChildTag > parent.getChildCount()) { indexOfNextChildTag = parent.getChildCount(); } parent.getChildren().add(indexOfNextChildTag, component); created = true; return (component); }
UIComponentClassicTagBase.getParentUIComponentClassicTagBase(pageContext); if (tag == null) { // PENDING - i18n throw new JspException("Not nested in a UIComponentTag"); UIComponent component = tag.getComponentInstance(); if (component == null) { // PENDING - i18n throw new JspException("No component associated with UIComponentTag"); FacesContext context = FacesContext.getCurrentInstance(); ExpressionFactory exprFactory = context.getApplication().getExpressionFactory(); ELContext elContext = context.getELContext(); .getValue(elContext); if (component.getAttributes().get(nameVal) == null) { component.getAttributes().put(nameVal, valueVal);
context = getFacesContext(); if (null == context) { if (null == getFacetName() && null != parentTag) { Tag p = this.getParent(); verbatim = parentTag.createVerbatimComponentFromBodyContent(); component = findComponent(context); addVerbatimBeforeComponent(parentTag, verbatim, component); clientId = getId(); getParentNamingContainerTag().getNamingContainerChildIds().get(clientId); && !this.getJspId().equals(temp.getJspId())) { tagInstance = this; } else if (temp != null && temp != this && this.getJspId().equals(temp.getJspId())) { if (getParentNamingContainerTag().getNamingContainerChildIds().containsKey(clientId)) { printTree(context.getViewRoot(), clientId, writer, 0); String msg = "Duplicate component id: '" + clientId
if (componentTag == null) throw new JspException("no parent UIComponentTag found"); UIComponent component = componentTag.getComponentInstance(); if (component == null) throw new JspException("parent UIComponentTag has no UIComponent"); FacesContext facesContext = FacesContext.getCurrentInstance(); ELContext elContext = facesContext.getELContext(); if (component.getAttributes().get(name) == null) component.getAttributes().put(name, value); component.setValueExpression(name, _valueExpression);
context = getFacesContext(); if (null == context) { parentTag = getParentUIComponentClassicTagBase(pageContext); Map<String,Object> requestMap = context.getExternalContext().getRequestMap(); Map<String,UIComponentTagBase> componentIds; if (parentTag == null) { if (null == getFacetName() && null != parentTag) { Tag p = this.getParent(); verbatim = parentTag.createVerbatimComponentFromBodyContent(); component = findComponent(context); addVerbatimBeforeComponent(parentTag, verbatim, component); && !this.getJspId().equals(temp.getJspId())) { tagInstance = this; } else if (temp != null && temp != this && this.getJspId().equals(temp.getJspId())) { printTree(context.getViewRoot(), clientId, writer, 0); String msg = "Duplicate component id: '" + clientId
UIComponentClassicTagBase parentTag = _getParentUIComponentClassicTagBase(context.getAttributes()); parentTag.getComponentInstance().getRendersChildren())) { if (null != (verbatim = this.createVerbatimComponentFromBodyContent())) { component.getAttributes().get(JSP_CREATED_COMPONENT_IDS); if (createdIds != null) { int listIdx = component.getChildCount(); if (createdIds.size() == listIdx) { component.getChildren().set((listIdx - 1), verbatim); component.getChildren().add(verbatim); parentTag.addChild(verbatim); return (getDoAfterBodyValue());
@Override public int doStartTag() throws JspException { if (log.isLoggable(Level.FINE)) log.fine("JSF 1.2 Spec : Create a new instance of the ActionListener"); ActionListener actionListener = new SetPropertyActionListener(target, value); UIComponentClassicTagBase tag = UIComponentClassicTagBase.getParentUIComponentClassicTagBase(pageContext); if (tag == null) throw new JspException("Could not find a " + "parent UIComponentClassicTagBase ... is this " + "tag in a child of a UIComponentClassicTagBase?"); if (tag.getCreated()) { UIComponent component = tag.getComponentInstance(); if (component == null) throw new JspException(" Could not locate a UIComponent " + "for a UIComponentClassicTagBase w/ a " + "JSP id of " + tag.getJspId()); if (!(component instanceof ActionSource)) throw new JspException("Component w/ id of " + component.getId() + " is associated w/ a tag w/ JSP id of " + tag.getJspId() + ". This component is of type " + component.getClass() + ", which is not an " + ActionSource.class); if (log.isLoggable(Level.FINE)) log.fine(" ... register it with the UIComponent " + "instance associated with our most immediately " + "surrounding UIComponentTagBase"); ((ActionSource)component).addActionListener(actionListener); } return SKIP_BODY; }
context = FacesContext.getCurrentInstance(); = (UIComponentClassicTagBase) req.getAttribute("caucho.jsf.parent"); parent = parentTag.getComponentInstance(); BodyContent body = parentTag.getBodyContent(); child = (UIComponent) binding.getValue(context.getELContext()); binding.setValue(context.getELContext(), child); parent.getChildren().add(child);
popUIComponentClassicTagBase(); removeOldChildren(); removeOldFacets(); UIComponentClassicTagBase parentTag = _getParentUIComponentClassicTagBase( context.getAttributes()); if (null != (verbatim = this.createVerbatimComponentFromBodyContent())) { component.getChildren().add(verbatim); if (null != parentTag) { parentTag.addChild(verbatim); throw new JspException(e); } finally { component = null; this.release(); return (getDoEndValue());
this._facesContext = getFacesContext(); _parentClassicTag = getParentUIComponentClassicTagBase(pageContext); if (!isFacet()) Tag parent = getParent(); verbatimComp = _parentClassicTag.createVerbatimComponentFromBodyContent(); _componentInstance = findComponent(_facesContext); addVerbatimBeforeComponent(_parentClassicTag, verbatimComp, _componentInstance); Map<String, Object> viewComponentIds = getViewComponentIds(); throw new JspException("Duplicated component Id: '" + clientId + "' " + "for component: '" + getPathToComponent(_componentInstance) + "'."); if (isFacet()) _parentClassicTag.addFacet(getFacetName()); _parentClassicTag.addChild(_componentInstance); pushTag(); return getDoStartValue();
context = FacesContext.getCurrentInstance(); = (UIComponentClassicTagBase) req.getAttribute("caucho.jsf.parent"); parent = parentTag.getComponentInstance(); child = (UIComponent) binding.getValue(context.getELContext()); parent.getFacets().put(facetName, child); binding.setValue(context.getELContext(), child);
@Override public int doStartTag() throws JspException { UIComponentClassicTagBase componentTag = UIComponentELTag.getParentUIComponentClassicTagBase(pageContext); if (componentTag == null) { throw new JspException("no parent UIComponentTag found"); } if (!componentTag.getCreated()) { return Tag.SKIP_BODY; } Validator validator = createValidator(); UIComponent component = componentTag.getComponentInstance(); if (component == null) { throw new JspException("parent UIComponentTag has no UIComponent"); } if (!(component instanceof EditableValueHolder)) { throw new JspException("UIComponent is no EditableValueHolder"); } ((EditableValueHolder)component).addValidator(validator); return Tag.SKIP_BODY; }
public int doAfterBody() throws JspException UIComponentClassicTagBase parentTag = getParentUIComponentClassicTagBase(pageContext); if (isRootTag(parentTag) || isInRenderedChildrenComponent(parentTag)) UIComponent verbatimComp = createVerbatimComponentFromBodyContent(); _componentInstance.getAttributes().get(FORMER_CHILD_IDS_SET_ATTR); _componentInstance.getChildren().add(verbatimComp); int index = _componentInstance.getChildCount(); if (childrenAddedIds.size() == index) parentTag.addChild(verbatimComp); return getDoAfterBodyValue();
public static UIComponent findFacet(FacesContext context, ServletRequest req, UIComponent parent, String facetName) throws Exception { if (context == null) FacesContext.getCurrentInstance(); if (parent == null) { UIComponentClassicTagBase parentTag = (UIComponentClassicTagBase) req.getAttribute("caucho.jsf.parent"); parent = parentTag.getComponentInstance(); } if (parent != null) return parent.getFacet(facetName); else return null; }
public static UIComponent addTransient(FacesContext context, ServletRequest req, UIComponent parent, String prevId, Class childClass) throws Exception { if (context == null) context = FacesContext.getCurrentInstance(); if (parent == null) { UIComponentClassicTagBase parentTag = (UIComponentClassicTagBase) req.getAttribute("caucho.jsf.parent"); parent = parentTag.getComponentInstance(); BodyContent body = parentTag.getBodyContent(); if (body != null) addVerbatim(parent, body); } UIComponent child = null;; if (child == null) child = (UIComponent) childClass.newInstance(); child.setTransient(true); addChild(parent, prevId, child); return child; }
@Override public int doStartTag() throws JspException { UIComponentClassicTagBase componentTag = UIComponentClassicTagBase.getParentUIComponentClassicTagBase(pageContext); if (componentTag == null) { throw new JspException("no parent UIComponentTag found"); } if (!componentTag.getCreated()) { return Tag.SKIP_BODY; } Converter converter = createConverter(); UIComponent component = componentTag.getComponentInstance(); if (component == null) { throw new JspException("parent UIComponentTag has no UIComponent"); } if (!(component instanceof ValueHolder)) { throw new JspException("UIComponent is no ValueHolder"); } ((ValueHolder)component).setConverter(converter); return Tag.SKIP_BODY; }
/** * <p>Add <i>verbatim</i> as a sibling of <i>component</i> in * <i>component</i> in the parent's child list. <i>verbatim</i> is * added to the list at the position immediatly following * <i>component</i>.</p> */ protected void addVerbatimAfterComponent(UIComponentClassicTagBase parentTag, UIComponent verbatim, UIComponent component) { int indexOfComponentInParent; UIComponent parent = component.getParent(); // invert the order of this if and the assignment below. Since this line is // here, it appears an early return is acceptable/desired if parent is null, // and, if it is null, we should probably check for that before we try to // access it. 2006-03-15 jdl if (null == parent) { return; } List<UIComponent> children = parent.getChildren(); indexOfComponentInParent = children.indexOf(component); if (children.size() - 1 == indexOfComponentInParent) { children.add(verbatim); } else { children.add(indexOfComponentInParent + 1, verbatim); } parentTag.addChild(verbatim); }