Package javax.faces.component

Examples of javax.faces.component.UIPanel


        processLifecycleExecute();
        locale = facesContext.getViewRoot().getLocale();

        executeBuildViewCycle(facesContext);
       
        UIPanel panel1_2 = (UIPanel) facesContext.getViewRoot().findComponent("mainForm:panel2");
        Assert.assertNotNull(panel1_2);
        Assert.assertEquals(1, panel1_2.getChildCount());
        Assert.assertEquals("added component through binding",
            panel1_2.getChildren().get(0).getAttributes().get("value"));
       
        UICommand submitButton = (UICommand) facesContext.getViewRoot().findComponent("mainForm:submit");

        executeViewHandlerRender(facesContext);
        executeAfterRender(facesContext);
       
        submit(submitButton);
       
        processLifecycleExecute();
       
        UIPanel panel2_2 = (UIPanel) facesContext.getViewRoot().findComponent("mainForm:panel2");
        Assert.assertNotNull(panel2_2);
        Assert.assertEquals(1, panel2_2.getChildCount());
        Assert.assertEquals("added component through binding",
            panel2_2.getChildren().get(0).getAttributes().get("value"));

        FaceletState faceletState = (FaceletState) facesContext.getViewRoot().getAttributes().get(
            ComponentSupport.FACELET_STATE_INSTANCE);       
       
        UIViewRoot root = new UIViewRoot();
View Full Code Here


        locale = facesContext.getViewRoot().getLocale();
       
        executeBeforeRender(facesContext);
        executeBuildViewCycle(facesContext);

        UIPanel panel1_3 = (UIPanel) facesContext.getViewRoot().findComponent("mainForm:panel3");
        Assert.assertNotNull(panel1_3);
        Assert.assertEquals(1, panel1_3.getChildCount());
        Assert.assertEquals("added component through binding",
            panel1_3.getChildren().get(0).getAttributes().get("value"));
       
        executeViewHandlerRender(facesContext);
        executeAfterRender(facesContext);
       
        UIViewRoot root = new UIViewRoot();
View Full Code Here

        processLifecycleExecute();
        locale = facesContext.getViewRoot().getLocale();

        executeBuildViewCycle(facesContext);
       
        UIPanel panel1_3 = (UIPanel) facesContext.getViewRoot().findComponent("mainForm:panel3");
        Assert.assertNotNull(panel1_3);
        Assert.assertEquals(1, panel1_3.getChildCount());
        Assert.assertEquals("added component through binding",
            panel1_3.getChildren().get(0).getAttributes().get("value"));
       
        UICommand submitButton = (UICommand) facesContext.getViewRoot().findComponent("mainForm:submit");

        executeViewHandlerRender(facesContext);
        executeAfterRender(facesContext);
       
        submit(submitButton);
       
        processLifecycleExecute();
       
        UIPanel panel2_3 = (UIPanel) facesContext.getViewRoot().findComponent("mainForm:panel3");
        Assert.assertNotNull(panel2_3);
        Assert.assertEquals(1, panel2_3.getChildCount());
        Assert.assertEquals("added component through binding",
            panel2_3.getChildren().get(0).getAttributes().get("value"));

        FaceletState faceletState = (FaceletState) facesContext.getViewRoot().getAttributes().get(
            ComponentSupport.FACELET_STATE_INSTANCE);       
       
        UIViewRoot root = new UIViewRoot();
View Full Code Here

        locale = facesContext.getViewRoot().getLocale();
       
        executeBeforeRender(facesContext);
        executeBuildViewCycle(facesContext);

        UIPanel panel1_4 = (UIPanel) facesContext.getViewRoot().findComponent("mainForm:panel4");
        Assert.assertNotNull(panel1_4);
        Assert.assertEquals(1, panel1_4.getChildCount());
       
        executeViewHandlerRender(facesContext);
        executeAfterRender(facesContext);
       
        UIViewRoot root = new UIViewRoot();
View Full Code Here

        processLifecycleExecute();
        locale = facesContext.getViewRoot().getLocale();

        executeBuildViewCycle(facesContext);
       
        UIPanel panel1_4 = (UIPanel) facesContext.getViewRoot().findComponent("mainForm:panel4");
        Assert.assertNotNull(panel1_4);
        Assert.assertEquals(1, panel1_4.getChildCount());
       
        UICommand submitButton = (UICommand) facesContext.getViewRoot().findComponent("mainForm:submit");

        executeViewHandlerRender(facesContext);
        executeAfterRender(facesContext);
       
        submit(submitButton);
       
        processLifecycleExecute();
       
        UIPanel panel2_4 = (UIPanel) facesContext.getViewRoot().findComponent("mainForm:panel4");
        Assert.assertNotNull(panel2_4);
        Assert.assertEquals(1, panel2_4.getChildCount());

        FaceletState faceletState = (FaceletState) facesContext.getViewRoot().getAttributes().get(
            ComponentSupport.FACELET_STATE_INSTANCE);       
       
        UIViewRoot root = new UIViewRoot();
View Full Code Here

        executeBuildViewCycle(facesContext);
       
        // Now let's try to remove some component programatically
        // that invalidates the view to be reused without a refresh,
        // so in the pool it should be marked as REFRESH_REQUIRED
        UIPanel panel = (UIPanel) facesContext.getViewRoot().findComponent("mainForm:panel1");
       
        panel.getParent().getChildren().remove(panel);
       
        executeViewHandlerRender(facesContext);
        executeAfterRender(facesContext);
       
        UIViewRoot root = new UIViewRoot();
View Full Code Here

        executeBuildViewCycle(facesContext);
       
        // Now let's try to remove some component programatically
        // that invalidates the view to be reused without a refresh,
        // so in the pool it should be marked as REFRESH_REQUIRED
        UIPanel panel = (UIPanel) facesContext.getViewRoot().findComponent("mainForm:panel1");
        panel.getParent().getChildren().remove(panel);

        UICommand submitButton = (UICommand) facesContext.getViewRoot().findComponent("mainForm:submit");

        executeViewHandlerRender(facesContext);
        executeAfterRender(facesContext);
View Full Code Here

        processLifecycleExecute();

        executeBeforeRender(facesContext);
        executeBuildViewCycle(facesContext);

        UIPanel headPanel = (UIPanel) facesContext.getViewRoot().getFacet("head");
        Assert.assertNotNull(headPanel);
        Assert.assertEquals(1, headPanel.getChildCount());
       
        String nextUniqueId = facesContext.getViewRoot().createUniqueId(facesContext, null);
       
        executeViewHandlerRender(facesContext);
        executeAfterRender(facesContext);
       
        UICommand button = (UICommand) facesContext.getViewRoot().findComponent("mainForm:postback");
        submit(button);
       
        processLifecycleExecute();
       
        ResourceDependencyBean bean = facesContext.getApplication().evaluateExpressionGet(
            facesContext, "#{resourceDependencyBean}", ResourceDependencyBean.class);
        bean.setIncludeContent(true);
       
        executeBeforeRender(facesContext);
        executeBuildViewCycle(facesContext);
       
        headPanel = (UIPanel) facesContext.getViewRoot().getFacet("head");
        Assert.assertNotNull(headPanel);
        Assert.assertEquals(1, headPanel.getChildCount());
        Assert.assertNotSame(nextUniqueId, headPanel.getChildren().get(0).getId());
       
        executeViewHandlerRender(facesContext);
        executeAfterRender(facesContext);
    }
View Full Code Here

        processLifecycleExecute();

        executeBeforeRender(facesContext);
        executeBuildViewCycle(facesContext);

        UIPanel headPanel = (UIPanel) facesContext.getViewRoot().getFacet("head");
        Assert.assertNull(headPanel);
       
        String nextUniqueId = facesContext.getViewRoot().createUniqueId(facesContext, null);
       
        executeViewHandlerRender(facesContext);
        executeAfterRender(facesContext);
       
        UICommand button = (UICommand) facesContext.getViewRoot().findComponent("mainForm:postback");
        submit(button);
       
        processLifecycleExecute();
       
        ResourceDependencyBean bean = facesContext.getApplication().evaluateExpressionGet(
            facesContext, "#{resourceDependencyBean}", ResourceDependencyBean.class);
        bean.setIncludeContent(true);
       
        executeBeforeRender(facesContext);
        executeBuildViewCycle(facesContext);
       
        headPanel = (UIPanel) facesContext.getViewRoot().getFacet("head");
        Assert.assertNotNull(headPanel);
        Assert.assertTrue(1 >= headPanel.getChildCount());
        Assert.assertNotSame(nextUniqueId, headPanel.getChildren().get(0).getId());
       
        executeViewHandlerRender(facesContext);
        executeAfterRender(facesContext);
       
        UICommand button2 = (UICommand) facesContext.getViewRoot().findComponent("mainForm:postback");
        submit(button2);
       
        processLifecycleExecute();
       
        bean = facesContext.getApplication().evaluateExpressionGet(
            facesContext, "#{resourceDependencyBean}", ResourceDependencyBean.class);
        bean.setIncludeContent(false);
       
        executeBeforeRender(facesContext);
        executeBuildViewCycle(facesContext);
       
        headPanel = (UIPanel) facesContext.getViewRoot().getFacet("head");
        Assert.assertNotNull(headPanel);
        Assert.assertTrue(1 >= headPanel.getChildCount());
        //Assert.assertNotSame(nextUniqueId, headPanel.getChildren().get(0).getId());
       
        executeViewHandlerRender(facesContext);
        executeAfterRender(facesContext);   
       
        UICommand button3 = (UICommand) facesContext.getViewRoot().findComponent("mainForm:postback");
        submit(button3);
       
        processLifecycleExecute();
       
        bean = facesContext.getApplication().evaluateExpressionGet(
            facesContext, "#{resourceDependencyBean}", ResourceDependencyBean.class);
        bean.setIncludeContent(true);
       
        executeBeforeRender(facesContext);
        executeBuildViewCycle(facesContext);
       
        headPanel = (UIPanel) facesContext.getViewRoot().getFacet("head");
        Assert.assertNotNull(headPanel);
        Assert.assertTrue(1 >= headPanel.getChildCount());
        //Assert.assertNotSame(nextUniqueId, headPanel.getChildren().get(0).getId());
       
        executeViewHandlerRender(facesContext);
        executeAfterRender(facesContext);
       
        UICommand button4 = (UICommand) facesContext.getViewRoot().findComponent("mainForm:postback");
        submit(button4);
       
        processLifecycleExecute();
       
        bean = facesContext.getApplication().evaluateExpressionGet(
            facesContext, "#{resourceDependencyBean}", ResourceDependencyBean.class);
        bean.setIncludeContent(false);
       
        executeBeforeRender(facesContext);
        executeBuildViewCycle(facesContext);
       
        headPanel = (UIPanel) facesContext.getViewRoot().getFacet("head");
        Assert.assertNotNull(headPanel);
        Assert.assertTrue(1 >= headPanel.getChildCount());
        //Assert.assertNotSame(nextUniqueId, headPanel.getChildren().get(0).getId());
       
        executeViewHandlerRender(facesContext);
        executeAfterRender(facesContext);
    }
View Full Code Here

    protected void applyCompositeComponentFacelet(FaceletContext faceletContext, UIComponent compositeComponentBase)
        throws IOException
    {
        FaceletCompositionContext mctx = FaceletCompositionContext.getCurrentInstance(faceletContext);
        AbstractFaceletContext actx = (AbstractFaceletContext) faceletContext;
        UIPanel compositeFacetPanel
                = (UIPanel) compositeComponentBase.getFacets().get(UIComponent.COMPOSITE_FACET_NAME);
        if (compositeFacetPanel == null)
        {
            compositeFacetPanel = (UIPanel)
                faceletContext.getFacesContext().getApplication().createComponent(
                    faceletContext.getFacesContext(), UIPanel.COMPONENT_TYPE, null);
            compositeFacetPanel.getAttributes().put(ComponentSupport.COMPONENT_ADDED_BY_HANDLER_MARKER,
                    Boolean.TRUE);
            compositeComponentBase.getFacets().put(UIComponent.COMPOSITE_FACET_NAME, compositeFacetPanel);
           
            // Set an id to the created facet component, to prevent id generation and make
            // partial state saving work without problem.
            UniqueIdVendor uniqueIdVendor = mctx.getUniqueIdVendorFromStack();
            if (uniqueIdVendor == null)
            {
                uniqueIdVendor = ComponentSupport.getViewRoot(faceletContext, compositeComponentBase);
            }
            if (uniqueIdVendor != null)
            {
                // UIViewRoot implements UniqueIdVendor, so there is no need to cast to UIViewRoot
                // and call createUniqueId()
                String uid = uniqueIdVendor.createUniqueId(faceletContext.getFacesContext(),
                        mctx.getSharedStringBuilder()
                        .append(compositeComponentBase.getId())
                        .append("__f_")
                        .append("cc_facet").toString());
                compositeFacetPanel.setId(uid);
            }           
        }
       
        // Before call applyCompositeComponent we need to add ajax behaviors
        // to the current compositeComponentBase. Note that super.applyNextHandler()
View Full Code Here

TOP

Related Classes of javax.faces.component.UIPanel

Copyright © 2018 www.massapicom. 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.