Package javax.faces.component.html

Examples of javax.faces.component.html.HtmlCommandButton


    public void setUp() throws Exception {
        super.setUp();
        writer = new MockResponseWriter(new StringWriter(), null, null);
        facesContext.setResponseWriter(writer);
        commandButton = new HtmlCommandButton();
        form = new HtmlForm();
        commandButton.setParent(form);
       
        facesContext.getViewRoot().setRenderKitId(MockRenderKitFactory.HTML_BASIC_RENDER_KIT);
        facesContext.getRenderKit().addRenderer(
View Full Code Here


        Assert.assertNotNull(compositeComponent1);
        UIComponent facet1 = compositeComponent1.getFacet(UIComponent.COMPOSITE_FACET_NAME);
        Assert.assertNotNull(facet1);
        HtmlOutputText text1 = (HtmlOutputText) facet1.findComponent("text");
        Assert.assertNotNull(text1);
        HtmlCommandButton button1 = (HtmlCommandButton) facet1.findComponent("button");
        Assert.assertNotNull(button1);
       
        compositeComponent1.pushComponentToEL(facesContext, compositeComponent1);
        facet1.pushComponentToEL(facesContext, facet1);
        text1.pushComponentToEL(facesContext, text1);
        //set on tag
        Assert.assertEquals(bean.getStyleClass(), text1.getStyleClass());
        //set as default
        Assert.assertEquals(bean.getStyle(), text1.getStyle());
       
        Assert.assertEquals(bean.getJavaProperty(), text1.getValue());
       
        text1.popComponentFromEL(facesContext);
        button1.pushComponentToEL(facesContext,  button1);
        MethodExpression method = button1.getActionExpression();
        Assert.assertEquals(bean.doSomethingFunny("xysj"), method.invoke(facesContext.getELContext(), new Object[]{"xysj"}));
        button1.popComponentFromEL(facesContext);
        facet1.popComponentFromEL(facesContext);
        compositeComponent1.popComponentFromEL(facesContext);
       
        StringWriter sw = new StringWriter();
        MockResponseWriter mrw = new MockResponseWriter(sw);
View Full Code Here

        Assert.assertNotNull(compositeComponent2);
        UIComponent facet2 = compositeComponent2.getFacet(UIComponent.COMPOSITE_FACET_NAME);
        Assert.assertNotNull(facet2);
        HtmlOutputText text1 = (HtmlOutputText) facet2.findComponent("text");
        Assert.assertNotNull(text1);
        HtmlCommandButton button1 = (HtmlCommandButton) facet2.findComponent("button");
        Assert.assertNotNull(button1);
       
        compositeComponent1.pushComponentToEL(facesContext, compositeComponent1);
        facet1.pushComponentToEL(facesContext, facet1);
        text1.pushComponentToEL(facesContext, text1);
        //set on tag
        Assert.assertEquals(bean.getStyleClass(), text1.getStyleClass());
        //set as default
        Assert.assertEquals(bean.getStyle(), text1.getStyle());
       
        Assert.assertEquals(bean.getJavaProperty(), text1.getValue());
       
        text1.popComponentFromEL(facesContext);
        button1.pushComponentToEL(facesContext,  button1);
        MethodExpression method = button1.getActionExpression();
        Assert.assertEquals(bean.doSomethingFunny("xysj"), method.invoke(facesContext.getELContext(), new Object[]{"xysj"}));
        button1.popComponentFromEL(facesContext);
        facet1.popComponentFromEL(facesContext);
        compositeComponent1.popComponentFromEL(facesContext);
       
        StringWriter sw = new StringWriter();
        MockResponseWriter mrw = new MockResponseWriter(sw);
View Full Code Here

        Assert.assertNotNull(panelGroup1);
        UINamingContainer compositeComponent1 = (UINamingContainer) panelGroup1.findComponent("cc1");
        Assert.assertNotNull(compositeComponent1);
        UIComponent facet1 = compositeComponent1.getFacet(UIComponent.COMPOSITE_FACET_NAME);
        Assert.assertNotNull(facet1);
        HtmlCommandButton button1 = (HtmlCommandButton) facet1.findComponent("submitButton");
        Assert.assertNotNull(button1);
        HtmlCommandButton button2 = (HtmlCommandButton) facet1.findComponent("cancelAction");
        Assert.assertNotNull(button2);
       
        compositeComponent1.pushComponentToEL(facesContext, compositeComponent1);
        facet1.pushComponentToEL(facesContext, facet1);
        button1.pushComponentToEL(facesContext,  button1);

        MethodExpression method = button1.getActionExpression();
        Assert.assertEquals("testActionMethodTypeSubmit", method.invoke(facesContext.getELContext(), null));
       
        Assert.assertEquals(1, button1.getActionListeners().length);
        button1.getActionListeners()[0].processAction(new ActionEvent(button1));
        Assert.assertTrue(bean.isSubmitActionListenerCalled());
       
        button1.popComponentFromEL(facesContext);
        button2.pushComponentToEL(facesContext,  button2);
       
        method = button2.getActionExpression();
        Assert.assertEquals(bean.cancelAction(), method.invoke(facesContext.getELContext(), null));
       
        Assert.assertEquals(1, button2.getActionListeners().length);
        button2.getActionListeners()[0].processAction(new ActionEvent(button2));
        Assert.assertTrue(bean.isCancelActionListenerCalled());
       
        button2.popComponentFromEL(facesContext);
        facet1.popComponentFromEL(facesContext);
        compositeComponent1.popComponentFromEL(facesContext);
       
        StringWriter sw = new StringWriter();
        MockResponseWriter mrw = new MockResponseWriter(sw);
View Full Code Here

        Assert.assertNotNull(compositeComponent2);
        UIComponent facet2 = compositeComponent2.getFacet(UIComponent.COMPOSITE_FACET_NAME);
        Assert.assertNotNull(facet2);
       
       
        HtmlCommandButton button1 = (HtmlCommandButton) facet2.findComponent("submitButton");
        Assert.assertNotNull(button1);
        HtmlCommandButton button2 = (HtmlCommandButton) facet2.findComponent("cancelAction");
        Assert.assertNotNull(button2);
       
        compositeComponent1.pushComponentToEL(facesContext, compositeComponent1);
        facet1.pushComponentToEL(facesContext, facet1);
        compositeComponent2.pushComponentToEL(facesContext, compositeComponent2);
        facet2.pushComponentToEL(facesContext, facet1);
        button1.pushComponentToEL(facesContext,  button1);

        MethodExpression method = button1.getActionExpression();
        Assert.assertEquals("testActionMethodTypeSubmit", method.invoke(facesContext.getELContext(), null));
       
        Assert.assertEquals(1, button1.getActionListeners().length);
        button1.getActionListeners()[0].processAction(new ActionEvent(button1));
        Assert.assertTrue(bean.isSubmitActionListenerCalled());
       
        button1.popComponentFromEL(facesContext);
        button2.pushComponentToEL(facesContext,  button2);
       
        method = button2.getActionExpression();
        Assert.assertEquals(bean.cancelAction(), method.invoke(facesContext.getELContext(), null));
       
        Assert.assertEquals(1, button2.getActionListeners().length);
        button2.getActionListeners()[0].processAction(new ActionEvent(button2));
        Assert.assertTrue(bean.isCancelActionListenerCalled());
       
        button2.popComponentFromEL(facesContext);
        facet2.popComponentFromEL(facesContext);
        compositeComponent2.popComponentFromEL(facesContext);
        facet1.popComponentFromEL(facesContext);
        compositeComponent1.popComponentFromEL(facesContext);
       
View Full Code Here

    }

    @Override
    protected UIComponent createComponentToTest()
    {
        return new HtmlCommandButton();
    }
View Full Code Here

    }

    @Override
    protected UIComponent createComponentToTest()
    {
        return new HtmlCommandButton();
    }
View Full Code Here

        Assert.assertNotNull(compositeComponent1);
        UIComponent facet1 = compositeComponent1.getFacet(UIComponent.COMPOSITE_FACET_NAME);
        Assert.assertNotNull(facet1);
        HtmlOutputText text1 = (HtmlOutputText) facet1.findComponent("text");
        Assert.assertNotNull(text1);
        HtmlCommandButton button1 = (HtmlCommandButton) facet1.findComponent("button");
        Assert.assertNotNull(button1);
       
        compositeComponent1.pushComponentToEL(facesContext, compositeComponent1);
        facet1.pushComponentToEL(facesContext, facet1);
        text1.pushComponentToEL(facesContext, text1);
        //set on tag
        Assert.assertEquals(bean.getStyleClass(), text1.getStyleClass());
        //set as default
        Assert.assertEquals(bean.getStyle(), text1.getStyle());
       
        Assert.assertEquals(bean.getJavaProperty(), text1.getValue());
       
        text1.popComponentFromEL(facesContext);
        button1.pushComponentToEL(facesContext,  button1);
        MethodExpression method = button1.getActionExpression();
        Assert.assertEquals(bean.doSomethingFunny("xysj"), method.invoke(facesContext.getELContext(), new Object[]{"xysj"}));
        button1.popComponentFromEL(facesContext);
        facet1.popComponentFromEL(facesContext);
        compositeComponent1.popComponentFromEL(facesContext);
       
        StringWriter sw = new StringWriter();
        MockResponseWriter mrw = new MockResponseWriter(sw);
View Full Code Here

        Assert.assertNotNull(compositeComponent2);
        UIComponent facet2 = compositeComponent2.getFacet(UIComponent.COMPOSITE_FACET_NAME);
        Assert.assertNotNull(facet2);
        HtmlOutputText text1 = (HtmlOutputText) facet2.findComponent("text");
        Assert.assertNotNull(text1);
        HtmlCommandButton button1 = (HtmlCommandButton) facet2.findComponent("button");
        Assert.assertNotNull(button1);
       
        compositeComponent1.pushComponentToEL(facesContext, compositeComponent1);
        facet1.pushComponentToEL(facesContext, facet1);
        text1.pushComponentToEL(facesContext, text1);
        //set on tag
        Assert.assertEquals(bean.getStyleClass(), text1.getStyleClass());
        //set as default
        Assert.assertEquals(bean.getStyle(), text1.getStyle());
       
        Assert.assertEquals(bean.getJavaProperty(), text1.getValue());
       
        text1.popComponentFromEL(facesContext);
        button1.pushComponentToEL(facesContext,  button1);
        MethodExpression method = button1.getActionExpression();
        Assert.assertEquals(bean.doSomethingFunny("xysj"), method.invoke(facesContext.getELContext(), new Object[]{"xysj"}));
        button1.popComponentFromEL(facesContext);
        facet1.popComponentFromEL(facesContext);
        compositeComponent1.popComponentFromEL(facesContext);
       
        StringWriter sw = new StringWriter();
        MockResponseWriter mrw = new MockResponseWriter(sw);
View Full Code Here

       
        //FactoryFinder.setFactory(FactoryFinder.VISIT_CONTEXT_FACTORY,
        //        VisitContextFactoryImpl.class.getName());

        renderKit.addRenderer(
                new HtmlCommandButton().getFamily(),
                new HtmlCommandButton().getRendererType(),
                new HtmlButtonRenderer());
        renderKit.addRenderer(
                new HtmlForm().getFamily(),
                new HtmlForm().getRendererType(),
                new HtmlFormRenderer());
View Full Code Here

TOP

Related Classes of javax.faces.component.html.HtmlCommandButton

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.