Package javax.faces.component.html

Examples of javax.faces.component.html.HtmlDataTable



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


    public void setUp() throws Exception
    {
        super.setUp();

        dataTable = new HtmlDataTable();

        writer = new MockResponseWriter(new StringWriter(), null, null);
        facesContext.setResponseWriter(writer);

        facesContext.getViewRoot().setRenderKitId(MockRenderKitFactory.HTML_BASIC_RENDER_KIT);
View Full Code Here


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

    }

    @Override
    protected void setUpRenderKit() throws Exception {
        super.setUpRenderKit();
        renderKit.addRenderer(HtmlDataTable.COMPONENT_FAMILY, new HtmlDataTable().getRendererType(), new Renderer(){});
        renderKit.addRenderer(HtmlOutputText.COMPONENT_FAMILY, new HtmlOutputText().getRendererType(), new Renderer(){});
        renderKit.addRenderer(HtmlInputText.COMPONENT_FAMILY, new HtmlInputText().getRendererType(), new Renderer(){});
    }
View Full Code Here

        }
       
        facesContext.getExternalContext().getRequestMap().put("items", list);
       
        UIViewRoot root = facesContext.getViewRoot();
        UIData data = new HtmlDataTable();
        data.setId("table");
        root.getChildren().add(data);
        data.setValue(new ListDataModel(list));
        data.setVar("item");
        data.setRows(rowCount);
       
        UIColumn col = new HtmlColumn();
        data.getChildren().add(col);

        UIOutput text = new HtmlOutputText();
        text.setId("text");
        text.setValue(facesContext.getApplication().
                getExpressionFactory().createValueExpression(
                facesContext.getELContext(), "#{item.name}", String.class));
        col.getChildren().add(text);
       
        for (int i = 0; i < rowCount ; i++)
        {
            data.setRowIndex(i);
            Assert.assertEquals(data.getId()+":"+i+":"+text.getId(), text.getClientId());
        }
        data.setRowIndex(-1);
        Assert.assertEquals(data.getId()+":"+text.getId(), text.getClientId());
    }
View Full Code Here

        startViewRequest("/table.xhtml");
        processLifecycleExecuteAndRender();
       
        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");
        client.submit(button);
        processLifecycleExecuteAndRender();

        comp = facesContext.getViewRoot().findComponent("mainForm:component");
        Assert.assertEquals(1, comp.getChildCount());
        dataTable = (HtmlDataTable) comp.getChildren().get(0);
        Assert.assertEquals(1, dataTable.getChildCount());
    }
View Full Code Here

        }
       
        facesContext.getExternalContext().getRequestMap().put("items", list);
       
        UIViewRoot root = facesContext.getViewRoot();
        UIData data = new HtmlDataTable();
        data.setId("table");
        root.getChildren().add(data);
        data.setValue(new ListDataModel(list));
        data.setVar("item");
        data.setRows(rowCount);
       
        UIColumn col = new HtmlColumn();
        data.getChildren().add(col);

        UIOutput text = new HtmlOutputText();
        text.setId("text");
        text.setValue(facesContext.getApplication().
                getExpressionFactory().createValueExpression(
                facesContext.getELContext(), "#{item.name}", String.class));
        col.getChildren().add(text);
       
        UIInput inputText = new HtmlInputText();
        inputText.setId("text");
        inputText.setValue(facesContext.getApplication().
                getExpressionFactory().createValueExpression(
                facesContext.getELContext(), "#{item.lastName}", String.class));
        col.getChildren().add(inputText);

        for (int i = 0; i < rowCount ; i++)
        {
            data.setRowIndex(i);
            Assert.assertEquals(data.getId()+":"+i+":"+text.getId(), text.getClientId());
            Assert.assertEquals(data.getId()+":"+i+":"+inputText.getId(), inputText.getClientId());
        }
        data.setRowIndex(-1);
        Assert.assertEquals(data.getId()+":"+text.getId(), text.getClientId());
        Assert.assertEquals(data.getId()+":"+inputText.getId(), inputText.getClientId());
    }
View Full Code Here

        int rowCount = 10;

        facesContext.getExternalContext().getRequestMap().put("items", list);
       
        UIViewRoot root = facesContext.getViewRoot();
        UIData data = new HtmlDataTable();
        data.setId("table");
        root.getChildren().add(data);
        data.setValue(new ListDataModel(list));
        data.setVar("item");
        data.setRows(rowCount);
       
        UIColumn col = new HtmlColumn();
        data.getChildren().add(col);

        UIOutput text = new HtmlOutputText();
        text.setId("text");
        text.setValue(facesContext.getApplication().
                getExpressionFactory().createValueExpression(
                facesContext.getELContext(), "#{item.name}", String.class));
        col.getChildren().add(text);
       
        data.setRowIndex(-1);
       
        data.processDecodes(facesContext);
       
        for (int i = 0; i < rowCount; i++)
        {
            list.add(new Item(i, "name"+i, "lastName"+i));
        }
       
        data.processDecodes(facesContext);
    }
View Full Code Here

        }
       
        facesContext.getExternalContext().getRequestMap().put("items", list);
       
        UIViewRoot root = facesContext.getViewRoot();
        UIData data = new HtmlDataTable();
        data.setId("table");
        root.getChildren().add(data);
        data.setValue(new ListDataModel(list));
        data.setVar("item");
        data.setRows(rowCount);
       
        UIColumn col = new HtmlColumn();
        data.getChildren().add(col);

        UIOutput text = new HtmlOutputText();
        text.setId("text");
        text.setValue(facesContext.getApplication().
                getExpressionFactory().createValueExpression(
                facesContext.getELContext(), "#{item.name}", String.class));
        col.getChildren().add(text);
       
        UIInput inputText = new HtmlInputText();
        inputText.setId("text");
        inputText.setValue(facesContext.getApplication().
                getExpressionFactory().createValueExpression(
                facesContext.getELContext(), "#{item.lastName}", String.class));
        col.getChildren().add(inputText);

        for (int i = 0; i < rowCount ; i++)
        {
            data.setRowIndex(i);
            inputText.setSubmittedValue("someString"+i);
        }
        data.setRowIndex(-1);
       
        for (int i = 0; i < rowCount ; i++)
        {
            data.setRowIndex(i);
            Assert.assertEquals("someString"+i, inputText.getSubmittedValue());
        }
    }
View Full Code Here

            captionClass = panelGrid.getCaptionClass();
            captionStyle = panelGrid.getCaptionStyle();
        }
        else if (component instanceof HtmlDataTable)
        {
            HtmlDataTable dataTable = (HtmlDataTable) component;
            captionClass = dataTable.getCaptionClass();
            captionStyle = dataTable.getCaptionStyle();
        }
        else
        {
            captionClass = (String) component.getAttributes()
                    .get(org.apache.myfaces.shared.renderkit.JSFAttr.CAPTION_CLASS_ATTR);
View Full Code Here

TOP

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

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.