private static int getComponentIndex(UIForm component) { if (component.getParent() == null) return -1; List<UIComponent> children = component.getParent().getChildren(); for (int i = 0; i < children.size(); i++) { if (children.get(i) == component) return i; } throw new IllegalStateException("Unable to determine index of component " + component); } }
public static void addForm(final FacesContext context, final UIForm form) { final Map map = context.getExternalContext().getRequestMap(); List forms = (List) map.get(KEY); if (forms == null) { forms = new ArrayList(); map.put(KEY, forms); registerRendererListener(form.getParent()); } forms.add(form.getId()); }
@Nullable public HtmlModalPanel getPropSetModalPanel() { UIForm configSetForm = FacesComponentUtility.getEnclosingForm(this); return (HtmlModalPanel) configSetForm.getParent().findComponent(getPropSetModalPanelId(this)); }
public boolean isListenerForSource(final Object source) { if (EnvUtils.isICEfacesView(FacesContext.getCurrentInstance()) && (source instanceof UIForm)) { UIForm form = (UIForm) source; String componentId = form.getId() + ID_SUFFIX; // Guard against duplicates within the same JSF lifecycle for (UIComponent comp : form.getParent().getChildren()) { if (componentId.equals(comp.getId())) { return false; } } return true; } else { return false; } } }
public void processEvent(SystemEvent event) throws AbortProcessingException { final NavigationNotifier navigationNotifier = (NavigationNotifier) event.getSource(); UIOutput setupComponent = new UIOutput() { public void encodeBegin(FacesContext context) throws IOException { ResponseWriter writer = context.getResponseWriter(); String id = navigationNotifier.getClientId(); writer.startElement("span", this); writer.writeAttribute("id", id + "_notifier", null); writer.startElement("script", this); writer.writeAttribute("type", "text/javascript", null); writer.write("ice.setupNavigationNotifier('" + id + "');"); writer.endElement("script"); writer.endElement("span"); } }; setupComponent.setTransient(true); UIForm form = getContainingForm(navigationNotifier); form.getParent().getChildren().add(setupComponent); }
/** * <p> * Override the {@link UIComponent#getContainerClientId} to allow users to disable this form * from prepending its <code>clientId</code> to its descendent's <code>clientIds</code> * depending on the value of this form's {@link #isPrependId} property. * </p> */ @Override public String getContainerClientId(FacesContext context) { if (isPrependId()) { return super.getContainerClientId(context); } UIComponent parent = getParent(); while (parent != null) { if (parent instanceof NamingContainer) { return parent.getContainerClientId(context); } parent = parent.getParent(); } return null; }
/** * <p>Override the {@link UIComponent#getContainerClientId} to allow * users to disable this form from prepending its <code>clientId</code> to * its descendent's <code>clientIds</code> depending on the value of * this form's {@link #isPrependId} property.</p> */ public String getContainerClientId(FacesContext context) { if (this.isPrependId()) { return super.getContainerClientId(context); } else { UIComponent parent = this.getParent(); while (parent != null) { if (parent instanceof NamingContainer) { return parent.getContainerClientId(context); } parent = parent.getParent(); } } return null; }
/** * <p>Override the {@link UIComponent#getContainerClientId} to allow * users to disable this form from prepending its <code>clientId</code> to * its descendent's <code>clientIds</code> depending on the value of * this form's {@link #isPrependId} property.</p> */ @Override public String getContainerClientId(FacesContext context) { if (this.isPrependId()) { return super.getContainerClientId(context); } else { UIComponent parent = this.getParent(); while (parent != null) { if (parent instanceof NamingContainer) { return parent.getContainerClientId(context); } parent = parent.getParent(); } } return null; }
/** * <p>Override the {@link UIComponent#getContainerClientId} to allow * users to disable this form from prepending its <code>clientId</code> to * its descendent's <code>clientIds</code> depending on the value of * this form's {@link #isPrependId} property.</p> */ @Override public String getContainerClientId(FacesContext context) { if (this.isPrependId()) { return super.getContainerClientId(context); } else { UIComponent parent = this.getParent(); while (parent != null) { if (parent instanceof NamingContainer) { return parent.getContainerClientId(context); } parent = parent.getParent(); } } return null; }
/** * <p>Override the {@link UIComponent#getContainerClientId} to allow * users to disable this form from prepending its <code>clientId</code> to * its descendent's <code>clientIds</code> depending on the value of * this form's {@link #isPrependId} property.</p> */ public String getContainerClientId(FacesContext context) { if (this.isPrependId()) { return super.getContainerClientId(context); } else { UIComponent parent = this.getParent(); while (parent != null) { if (parent instanceof NamingContainer) { return parent.getContainerClientId(context); } parent = parent.getParent(); } } return null; }
/** * <p>Override the {@link UIComponent#getContainerClientId} to allow * users to disable this form from prepending its <code>clientId</code> to * its descendent's <code>clientIds</code> depending on the value of * this form's {@link #isPrependId} property.</p> */ public String getContainerClientId(FacesContext context) { if (this.isPrependId()) { return super.getContainerClientId(context); } else { UIComponent parent = this.getParent(); while (parent != null) { if (parent instanceof NamingContainer) { return parent.getContainerClientId(context); } parent = parent.getParent(); } } return null; }
/** * <p> * Override the {@link UIComponent#getContainerClientId} to allow users to disable this form * from prepending its <code>clientId</code> to its descendent's <code>clientIds</code> * depending on the value of this form's {@link #isPrependId} property. * </p> */ @Override public String getContainerClientId(FacesContext context) { if (isPrependId()) { return super.getContainerClientId(context); } UIComponent parent = getParent(); while (parent != null) { if (parent instanceof NamingContainer) { return parent.getContainerClientId(context); } parent = parent.getParent(); } return null; }
/** * <p> * Override the {@link UIComponent#getContainerClientId} to allow users to disable this form * from prepending its <code>clientId</code> to its descendent's <code>clientIds</code> * depending on the value of this form's {@link #isPrependId} property. * </p> */ @Override public String getContainerClientId(FacesContext context) { if (isPrependId()) { return super.getContainerClientId(context); } UIComponent parent = getParent(); while (parent != null) { if (parent instanceof NamingContainer) { return parent.getContainerClientId(context); } parent = parent.getParent(); } return null; }
/** * <p>Override the {@link UIComponent#getContainerClientId} to allow * users to disable this form from prepending its <code>clientId</code> to * its descendent's <code>clientIds</code> depending on the value of * this form's {@link #isPrependId} property.</p> */ @Override public String getContainerClientId(FacesContext context) { if (this.isPrependId()) { return super.getContainerClientId(context); } else { UIComponent parent = this.getParent(); while (parent != null) { if (parent instanceof NamingContainer) { return parent.getContainerClientId(context); } parent = parent.getParent(); } } return null; }
/** * <p> * Override the {@link UIComponent#getContainerClientId} to allow users to disable this form * from prepending its <code>clientId</code> to its descendent's <code>clientIds</code> * depending on the value of this form's {@link #isPrependId} property. * </p> */ @Override public String getContainerClientId(FacesContext context) { if (isPrependId()) { return super.getContainerClientId(context); } UIComponent parent = getParent(); while (parent != null) { if (parent instanceof NamingContainer) { return parent.getContainerClientId(context); } parent = parent.getParent(); } return null; }