@Override
public void onComponentCreated(FaceletContext ctx, UIComponent c, UIComponent parent) {
super.onComponentCreated(ctx, c, parent);
AbstractAttachQueue attachQueue = ((AbstractAttachQueue) c);
boolean associateWithParent = true;
AttachQueueStack attachQueueStack = AttachQueueStack.getStack(ctx.getFacesContext(), false);
if (attachQueueStack != null) {
AttachQueueInfo attachQueueInfo = attachQueueStack.peek();
if (attachQueueInfo != null) {
UIComponent queueInfoParent = attachQueueInfo.getParentComponent();
if (queueInfoParent.equals(parent)) {
attachQueueInfo.setAttachQueue(attachQueue);
associateWithParent = false;
}
}
}
if (associateWithParent) {
attachQueue.associateWith(parent);
}
}