Package javax.faces.component

Examples of javax.faces.component.UICommand


        Assert.assertEquals(3, comp.getChildCount());
        Assert.assertEquals("1", comp.getChildren().get(0).getAttributes().get("value"));
        Assert.assertEquals("2", comp.getChildren().get(1).getAttributes().get("value"));
        Assert.assertEquals("text3", comp.getChildren().get(2).getId());
       
        UICommand button = (UICommand) facesContext.getViewRoot().findComponent("mainForm:postback");
        submit(button);
        processLifecycleExecuteAndRender();
       
        comp = facesContext.getViewRoot().findComponent("mainForm:component");
        Assert.assertEquals(3, comp.getChildCount());
View Full Code Here


        UIComponent comp = facesContext.getViewRoot().findComponent("mainForm:component");
        Assert.assertEquals(1, comp.getChildCount());
        HtmlDataTable dataTable = (HtmlDataTable) comp.getChildren().get(0);
        Assert.assertEquals(1, dataTable.getChildCount());

        UICommand button = (UICommand) facesContext.getViewRoot().findComponent("mainForm:postback");
        submit(button);
        processLifecycleExecuteAndRender();

        comp = facesContext.getViewRoot().findComponent("mainForm:component");
        Assert.assertEquals(1, comp.getChildCount());
View Full Code Here

        UIComponent comp = facesContext.getViewRoot().findComponent("mainForm:component");
        Assert.assertEquals(2, comp.getChildCount());
        Assert.assertEquals("Manually added child 2<br/>", comp.getChildren().get(0).getAttributes().get("value"));
        Assert.assertEquals("Manually added child 1<br/>", comp.getChildren().get(1).getAttributes().get("value"));

        UICommand button = (UICommand) facesContext.getViewRoot().findComponent("mainForm:postback");
        submit(button);
        processLifecycleExecuteAndRender();

        comp = facesContext.getViewRoot().findComponent("mainForm:component");
        Assert.assertEquals(2, comp.getChildCount());
View Full Code Here

        //Set a token to save on the state as delta
        UIComponent component = facesContext.getViewRoot().findComponent("mainForm:component1");
        component.getAttributes().put("test", "test1");
        processRender();
       
        UICommand button = (UICommand) facesContext.getViewRoot().findComponent("mainForm:page1");
        submit(button);
        processLifecycleExecute();
        //Check it is restored
        component = facesContext.getViewRoot().findComponent("mainForm:component1");
        Assert.assertEquals("test1", component.getAttributes().get("test"));
View Full Code Here

        //Set a token to save on the state as delta
        UIComponent component = facesContext.getViewRoot().findComponent("mainForm:component1");
        Assert.assertNotNull(component);
        processRender();
       
        UICommand button = (UICommand) facesContext.getViewRoot().findComponent("mainForm:page1");
        submit(button);
       
        processLifecycleExecute();
        //Check it is restored
        component = facesContext.getViewRoot().findComponent("mainForm:component1");
View Full Code Here

       
        UIComponent comp = facesContext.getViewRoot().findComponent("panel");
        Assert.assertNotNull(comp);
        Assert.assertEquals(1, comp.getChildCount());
       
        UICommand button = (UICommand) facesContext.getViewRoot().findComponent("mainForm:postback");
        submit(button);
        processLifecycleExecuteAndRender();
        Assert.assertNotNull(comp);
        // Even if in the postback two components were added, pss algorithm must replace the
        // component with the one saved.
View Full Code Here

        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(
View Full Code Here

        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(
View Full Code Here

       
        UIComponent comp = facesContext.getViewRoot().findComponent("mainForm:component");
        Assert.assertEquals(1, comp.getChildCount());
        Assert.assertEquals("Dynamically added child", comp.getChildren().get(0).getAttributes().get("value"));
       
        UICommand button = (UICommand) facesContext.getViewRoot().findComponent("mainForm:postback");
        submit(button);
        processLifecycleExecuteAndRender();
       
        comp = facesContext.getViewRoot().findComponent("mainForm:component");
        Assert.assertEquals(1, comp.getChildCount());
View Full Code Here

        Assert.assertEquals(2, wrapper.getChildCount());
        Assert.assertEquals("Dynamically added child", wrapper.getChildren().get(1).getAttributes().get("value"));
        MockPrintWriter writer1 = (MockPrintWriter) response.getWriter();
        Assert.assertTrue(new String(writer1.content()).contains("Dynamically added markup"));
       
        UICommand button = (UICommand) facesContext.getViewRoot().findComponent("mainForm:postback");
        submit(button);
        processLifecycleExecuteAndRender();
       
        comp = facesContext.getViewRoot().findComponent("mainForm:component");
        Assert.assertEquals(1, comp.getChildCount());
View Full Code Here

TOP

Related Classes of javax.faces.component.UICommand

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.