Examples of addComponentResource()


Examples of javax.faces.component.UIViewRoot.addComponentResource()

        List<UIComponent> components = root.getComponentResources(facesContext, "head");
        assertNotNull(components);
        assertTrue(components.size() == 1);
        assertTrue(components.get(0) == resource);
        UIOutput resource2 = new UIOutput();
        root.addComponentResource(facesContext, resource2);
        assertTrue(components.size() == 2);
        assertTrue(components.get(1) == resource2);
        root.addComponentResource(facesContext, resource2, "form");
        components = root.getComponentResources(facesContext, "form");
        assertTrue(components.size() == 1);
View Full Code Here

Examples of javax.faces.component.UIViewRoot.addComponentResource()

        assertTrue(components.get(0) == resource);
        UIOutput resource2 = new UIOutput();
        root.addComponentResource(facesContext, resource2);
        assertTrue(components.size() == 2);
        assertTrue(components.get(1) == resource2);
        root.addComponentResource(facesContext, resource2, "form");
        components = root.getComponentResources(facesContext, "form");
        assertTrue(components.size() == 1);
        root.addComponentResource(facesContext, resource2, "body");
        components = root.getComponentResources(facesContext, "body");
        assertTrue(components.size() == 1);
View Full Code Here

Examples of javax.faces.component.UIViewRoot.addComponentResource()

        assertTrue(components.size() == 2);
        assertTrue(components.get(1) == resource2);
        root.addComponentResource(facesContext, resource2, "form");
        components = root.getComponentResources(facesContext, "form");
        assertTrue(components.size() == 1);
        root.addComponentResource(facesContext, resource2, "body");
        components = root.getComponentResources(facesContext, "body");
        assertTrue(components.size() == 1);

        // the default implementation masks the facet name values
        // of head and form to ensure there are no collisions with valid
View Full Code Here

Examples of javax.faces.component.UIViewRoot.addComponentResource()

        assertNotNull(root.getFacet("javax_faces_location_HEAD"));
        assertNotNull(root.getFacet("javax_faces_location_FORM"));
        assertNotNull(root.getFacet("javax_faces_location_BODY"));

        // custom locations will also be masked
        root.addComponentResource(facesContext, resource2, "gt");
        assertNotNull(root.getFacet("javax_faces_location_gt"));
        components = root.getComponentResources(facesContext, "gt");
        assertTrue(components.size() == 1);

    }
View Full Code Here

Examples of javax.faces.component.UIViewRoot.addComponentResource()

            // so if we simply relied on the default logic, the resources
            // wouldn't be be moved.  We'll do it manually instead.
            String target = getLocationTarget(ctx);
            if (target != null) {
                final UIViewRoot root = ctx.getFacesContext().getViewRoot();
                root.addComponentResource(ctx.getFacesContext(), c, target);
            } else {
                super.addComponentToView(ctx, parent, c, componentFound);
            }
        }
View Full Code Here

Examples of javax.faces.component.UIViewRoot.addComponentResource()

            // so if we simply relied on the default logic, the resources
            // wouldn't be be moved.  We'll do it manually instead.
            String target = getLocationTarget(ctx);
            if (target != null) {
                final UIViewRoot root = ctx.getFacesContext().getViewRoot();
                root.addComponentResource(ctx.getFacesContext(), c, target);
            } else {
                super.addComponentToView(ctx, parent, c, componentFound);
            }
        }
View Full Code Here

Examples of javax.portlet.faces.component.PortletNamingContainerUIViewRoot.addComponentResource()

    // in order to prevent events from firing during the relocation process.
    for (UIComponent uiComponentResource : resourcesForRelocatingToBody) {

      uiComponentResource.getAttributes().put(ORIGINAL_TARGET, StringPool.HEAD);
      uiComponentResource.getAttributes().put(ADDED, Boolean.TRUE);
      uiViewRoot.addComponentResource(facesContext, uiComponentResource, StringPool.BODY);

      if (logger.isDebugEnabled()) {
        ComponentResource componentResource = componentResourceFactory.getComponentResource(
            uiComponentResource);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.