Examples of HtmlCommandButton


Examples of javax.faces.component.html.HtmlCommandButton

     * @param idSuffix The suffix identifying the {@link javax.faces.component.html.HtmlCommandButton} to be returned
     * @param text     The text on command button
     * @return created or existed command button component
     */
    public static HtmlCommandButton createButtonFacet(FacesContext context, UIComponent parent, String idSuffix, String text) {
        HtmlCommandButton prevBtn = getOrCreateFacet(
                context, parent, HtmlCommandButton.COMPONENT_TYPE, idSuffix, HtmlCommandButton.class);
        prevBtn.setValue(text);
        return prevBtn;
    }
View Full Code Here

Examples of javax.faces.component.html.HtmlCommandButton

        return panelGrid;
    }

    private HtmlCommandButton addButton(FacesContext context, UIComponent parent, String id, String text) {
        HtmlCommandButton btn = (HtmlCommandButton) Components.createChildComponent(context, parent, HtmlCommandButton.COMPONENT_TYPE, id);
        btn.setValue(text);
        return btn;
    }
View Full Code Here

Examples of javax.faces.component.html.HtmlCommandButton

                super.encodeCellContents(context, writer, component, rowIndex, colIndex);
                if (rowIndex == components.length - 1) {
                    writer.startElement("div", component);
                    writer.writeAttribute("class", "o_eventEditor_buttonsArea", null);

                    HtmlCommandButton deleteButton = Components.createButtonFacet(context, dialog, "deleteButton", dialog.getDeleteButtonText());
                    deleteButton.setStyle(Styles.mergeStyles("float: left", dialog.getDeleteButtonStyle()));
                    deleteButton.setStyleClass(dialog.getDeleteButtonClass());
                    deleteButton.encodeAll(context);

                    HtmlCommandButton okButton = Components.createButtonFacet(context, dialog, "okButton", dialog.getOkButtonText());
                    okButton.setStyle(dialog.getOkButtonStyle());
                    okButton.setStyleClass(dialog.getOkButtonClass());
                    okButton.encodeAll(context);
                    HtmlCommandButton cancelButton = Components.createButtonFacet(context, dialog, "cancelButton", dialog.getCancelButtonText());
                    writer.write(HTML.NBSP_ENTITY);
                    cancelButton.setStyle(dialog.getCancelButtonStyle());
                    cancelButton.setStyleClass(dialog.getCancelButtonClass());
                    cancelButton.encodeAll(context);
                    writer.endElement("div");

                    Rendering.renderInitScript(context, new ScriptBuilder().functionCall("O$.Timetable._initEventEditorDialog",
                            timetableView,
                            dialog,
View Full Code Here

Examples of javax.faces.component.html.HtmlCommandButton

            noFilterText.setStyleClass(DEFAULT_NO_FILTER_TEXT_CLASS);
            noFilterText.setValue(compositeFilter.getNoFilterMessage());

            HtmlPanelGroup addButtonContainer = (HtmlPanelGroup) Components.createChildComponent(context, rowContainer, HtmlPanelGroup.COMPONENT_TYPE, FilterRow.ADD_BUTTON_CONTAINER_SUFFIX);
            addButtonContainer.setStyleClass(FilterRow.DEFAULT_ROW_ITEM_CLASS);
            HtmlCommandButton addButton = (HtmlCommandButton) Components.createChildComponent(context, addButtonContainer, HtmlCommandButton.COMPONENT_TYPE, FilterRow.BUTTON_SUFFIX);
            addButton.setValue("+");
            addButton.setStyleClass(FilterRow.DEFAULT_ADD_BUTTON_CLASS);
        }
        rowContainer.encodeAll(context);
    }
View Full Code Here

Examples of javax.faces.component.html.HtmlCommandButton

        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

Examples of javax.faces.component.html.HtmlCommandButton

        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

Examples of javax.faces.component.html.HtmlCommandButton

    }

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

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

Examples of javax.faces.component.html.HtmlCommandButton

       
        //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

Examples of javax.faces.component.html.HtmlCommandButton

            HtmlInputText input = new HtmlInputText();
            input.setValue("var");
            input.setId("var1");
           
            HtmlCommandButton button = new HtmlCommandButton();
            button.setId("button1");
           
            UIForm form = new HtmlForm();
            form.setId("form1");
           
            form.getChildren().add(output);
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.