@Override public BaseComponent set(int index, BaseComponent child) { BaseComponent old = get(index); old.detach(); add(index, child); return old; }
/** * Sets or removes the command target for the specified component. * * @param component The bound component whose command target is being modified. * @param commandTarget If null, any associated command target is removed. Otherwise, this value * is set as the command target. */ private void setCommandTarget(BaseComponent component, BaseComponent commandTarget) { if (commandTarget == null) { commandTarget = (BaseComponent) component.removeAttribute(getTargetAttributeName()); if (commandTarget != null && commandTarget.hasAttribute(ATTR_DUMMY)) { commandTarget.detach(); } } else { component.setAttribute(getTargetAttributeName(), commandTarget); } }