/** * @see javax.faces.component.UIComponentBase#getFacets() */ public Map getFacets() { return original.getFacets(); }
/** * Invoke the registered cleanup method for the bean's instance */ public void invokeCleanupMethod() { if (instance instanceof UIViewRoot) { UIViewRoot uiViewRoot = ((UIViewRoot)instance); uiViewRoot.getChildren().clear(); uiViewRoot.getFacets().clear(); } }
private static UIComponent getHeadResourceContainer(UIViewRoot root) { String facetName = EnvUtils.isMojarra() ? "javax_faces_location_HEAD": "head"; return root.getFacets().get(facetName); }
public static UIComponent getResourceContainer(UIViewRoot root, String target) { String facetName = EnvUtils.isMojarra() ? "javax_faces_location_" + target.toUpperCase() : target; return root.getFacets().get(facetName); }
public UIComponent findChildByTagId(FaceletContext ctx, UIComponent parent, String id) { UIComponent c = null; UIViewRoot root = ComponentSupport.getViewRoot(ctx, parent); Iterator<UIComponent> itr = root.getFacets().values().iterator(); while (itr.hasNext() && c == null) { UIComponent facet = itr.next(); c = ComponentSupport.findChildByTagId(facet, id); } return c; }
public UIComponent findChildByTagId(FaceletContext ctx, UIComponent parent, String id) { UIComponent c = null; UIViewRoot root = ComponentSupport.getViewRoot(ctx, parent); if (root.getFacetCount() > 0) { Iterator<UIComponent> itr = root.getFacets().values().iterator(); while (itr.hasNext() && c == null) { UIComponent facet = itr.next(); c = ComponentSupport.findChildByTagId(facet, id); } } return c; }
@Override public UIComponent findChildByTagId(FaceletContext ctx, UIComponent parent, String id) { UIComponent c = null; UIViewRoot root = ComponentSupport.getViewRoot(ctx, parent); if (root.getFacetCount() > 0) { Iterator<UIComponent> itr = root.getFacets().values().iterator(); while (itr.hasNext() && c == null) { UIComponent facet = itr.next(); c = ComponentSupport.findChildByTagId(facet, id); } } return c; }
@Override public UIComponent findChildByTagId(FaceletContext ctx, UIComponent parent, String id) { UIComponent c = null; UIViewRoot root = ComponentSupport.getViewRoot(ctx, parent); if (root.getFacetCount() > 0) { Iterator<UIComponent> itr = root.getFacets().values().iterator(); while (itr.hasNext() && c == null) { UIComponent facet = itr.next(); c = ComponentSupport.findChildByTagId(facet, id); } } return c; }
public static UIViewRoot findRoot(FacesContext context, ServletRequest req, Object etag) throws Exception { if (context == null) context = FacesContext.getCurrentInstance(); UIViewRoot root = context.getViewRoot(); if (root == null) throw new NullPointerException(L.l("f:view can't find current in FacesContext")); Object oldETag = root.getAttributes().get("caucho.etag"); if (oldETag != null && ! oldETag.equals(etag)) { // clear view on JSP change root.getChildren().clear(); root.getFacets().clear(); } root.getAttributes().put("caucho.etag", etag); return root; }
private List<UIComponent> getComponentResources(FacesContext context, String target, boolean create) { String location = getIdentifier(target); UIComponent facet = getFacet(location); if (facet == null && create) { // Using an implementation specific component type to prevent // component resources being rendered at the incorrect time if // a caller calls UIViewRoot.encodeAll(). facet = context.getApplication().createComponent("javax.faces.ComponentResourceContainer"); facet.setId(location); getFacets().put(location, facet); } return ((facet != null) ? facet.getChildren() : null); }
@SuppressWarnings({"UnusedDeclaration"}) private List<UIComponent> getComponentResources(FacesContext context, String target, boolean create) { String location = getIdentifier(target); UIComponent facet = getFacet(location); if (facet == null && create) { // Using an implementation specific component type to prevent // component resources being rendered at the incorrect time if // a caller calls UIViewRoot.encodeAll(). facet = context.getApplication().createComponent("javax.faces.ComponentResourceContainer"); facet.setId(location); getFacets().put(location, facet); } return ((facet != null) ? facet.getChildren() : null); }
private List<UIComponent> getComponentResources(FacesContext context, String target, boolean create) { String location = getIdentifier(target); UIComponent facet = getFacet(location); if (facet == null && create) { // Using an implementation specific component type to prevent // component resources being rendered at the incorrect time if // a caller calls UIViewRoot.encodeAll(). facet = context.getApplication().createComponent("javax.faces.ComponentResourceContainer"); facet.setId(location); getFacets().put(location, facet); } return ((facet != null) ? facet.getChildren() : null); }
public void processEvent(SystemEvent event) throws AbortProcessingException { FacesContext context = FacesContext.getCurrentInstance(); //make resource containers transient so that the removal and addition of resource is not track by the JSF state saving Collection<UIComponent> facets = context.getViewRoot().getFacets().values(); for (UIComponent c: facets) { c.setInView(false); } //add mandatory resources, replace any resources previously added by JSF addMandatoryResources(context); //jsf.js might be added already by a page or component UIComponent jsfResource = ResourceOutputUtil.createTransientScriptResourceComponent("jsf.js", "javax.faces"); //add jsf.js resource or replace it if already added by JSF addOrCollectReplacingResource(context, "jsf.js", "javax.faces", "head", jsfResource); //restore resource containers to non-transient state for (UIComponent c: facets) { c.setInView(true); } }
private List<UIComponent> getComponentResources(FacesContext context, String target, boolean create) { String location = getIdentifier(target); UIComponent facet = getFacet(location); if (facet == null && create) { // Using an implementation specific component type to prevent // component resources being rendered at the incorrect time if // a caller calls UIViewRoot.encodeAll(). facet = context.getApplication().createComponent("javax.faces.ComponentResourceContainer"); facet.setId(location); getFacets().put(location, facet); } return ((facet != null) ? facet.getChildren() : null); }
private List<UIComponent> getComponentResources(FacesContext context, String target, boolean create) { String location = getIdentifier(target); UIComponent facet = getFacet(location); if (facet == null && create) { // Using an implementation specific component type to prevent // component resources being rendered at the incorrect time if // a caller calls UIViewRoot.encodeAll(). facet = context.getApplication().createComponent("javax.faces.ComponentResourceContainer"); facet.setId(location); getFacets().put(location, facet); } return ((facet != null) ? facet.getChildren() : null); }
@SuppressWarnings({"UnusedDeclaration"}) private List<UIComponent> getComponentResources(FacesContext context, String target, boolean create) { String location = getIdentifier(target); UIComponent facet = getFacet(location); if (facet == null && create) { // Using an implementation specific component type to prevent // component resources being rendered at the incorrect time if // a caller calls UIViewRoot.encodeAll(). facet = context.getApplication().createComponent("javax.faces.ComponentResourceContainer"); facet.setId(location); getFacets().put(location, facet); } return ((facet != null) ? facet.getChildren() : null); }
private List<UIComponent> getComponentResources(FacesContext context, String target, boolean create) { String location = getIdentifier(target); UIComponent facet = getFacet(location); if (facet == null && create) { // Using an implementation specific component type to prevent // component resources being rendered at the incorrect time if // a caller calls UIViewRoot.encodeAll(). facet = context.getApplication().createComponent("javax.faces.ComponentResourceContainer"); facet.setId(location); getFacets().put(location, facet); } return ((facet != null) ? facet.getChildren() : null); }
private List<UIComponent> getComponentResources(FacesContext context, String target, boolean create) { String location = getIdentifier(target); UIComponent facet = getFacet(location); if (facet == null && create) { // Using an implementation specific component type to prevent // component resources being rendered at the incorrect time if // a caller calls UIViewRoot.encodeAll(). facet = context.getApplication().createComponent("javax.faces.ComponentResourceContainer"); facet.setId(location); getFacets().put(location, facet); } return ((facet != null) ? facet.getChildren() : null); }
@SuppressWarnings({"UnusedDeclaration"}) private List<UIComponent> getComponentResources(FacesContext context, String target, boolean create) { String location = getIdentifier(target); UIComponent facet = getFacet(location); if (facet == null && create) { // Using an implementation specific component type to prevent // component resources being rendered at the incorrect time if // a caller calls UIViewRoot.encodeAll(). facet = context.getApplication().createComponent("javax.faces.ComponentResourceContainer"); facet.setId(location); getFacets().put(location, facet); } return ((facet != null) ? facet.getChildren() : null); }
private List<UIComponent> getComponentResources(FacesContext context, String target, boolean create) { String location = getIdentifier(target); UIComponent facet = getFacet(location); if (facet == null && create) { // Using an implementation specific component type to prevent // component resources being rendered at the incorrect time if // a caller calls UIViewRoot.encodeAll(). facet = context.getApplication().createComponent("javax.faces.ComponentResourceContainer"); facet.setId(location); getFacets().put(location, facet); } return ((facet != null) ? facet.getChildren() : null); }