Package com.vaadin.ui

Examples of com.vaadin.ui.Table.addItem()


        Table t = new Table("This is a table");
        t.addContainerProperty(P1, Component.class, null);
        t.addContainerProperty(P2, Component.class, null);
        t.setColumnHeaders(new String[] { "Col1", "Col2" });

        Item i = t.addItem("1");
        i.getItemProperty(P1).setValue(new TextField("abc"));
        i.getItemProperty(P2).setValue(new Label("label"));
        Item i2 = t.addItem("2");
        i2.getItemProperty(P1).setValue(new Button("def"));
        i2.getItemProperty(P2).setValue(new DateField());
View Full Code Here


        t.setColumnHeaders(new String[] { "Col1", "Col2" });

        Item i = t.addItem("1");
        i.getItemProperty(P1).setValue(new TextField("abc"));
        i.getItemProperty(P2).setValue(new Label("label"));
        Item i2 = t.addItem("2");
        i2.getItemProperty(P1).setValue(new Button("def"));
        i2.getItemProperty(P2).setValue(new DateField());

        layout.addComponent(t);
    }
View Full Code Here

                textField.setWidth("100%");
                return textField;
            }
        });

        table.addItem();

        table.setWidth("200px");
        table.setColumnWidth(COL1, 100);

        addComponent(table);
View Full Code Here

        table.setColumnWidth("Col1", 150);

        table.setWidth("400px");

        table.addItem(new Object[] { "Cell 1", "Cell 2" }, new Object());

        addComponent(table);
        addComponent(new Button("Uncollapse col2", new Button.ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
View Full Code Here

        final Table table = new Table();
        table.setImmediate(true);
        table.addContainerProperty("p1", String.class, "p1");
        table.addContainerProperty("p2", String.class, "p2");
        for (int i = 0; i < 200; ++i) {
            final Item item = table.getItem(table.addItem());
            item.getItemProperty("p2").setValue(i + "");
            item.getItemProperty("p1").setValue(i + "");
        }
        table.addListener(new ItemClickListener() {
            @Override
View Full Code Here

                }
            }
        });

        for (int i = 0; i < 200; i++) {
            table.addItem(new Object[] { new Integer(i) }, new Integer(i));
        }

        table.setCurrentPageFirstItemIndex(185);

        final CssLayout layout = new CssLayout();
View Full Code Here

        // Create example data
        table.addContainerProperty(ItemProperty.COLUMN1, String.class, null);
        table.addContainerProperty(ItemProperty.COLUMN2, String.class, null);
        for (int i = 1; i < 100; i++) {
            table.addItem(new String[] { "Item " + i, null }, i);
        }

        // Add action button
        addComponent(new Button("Do It", new Button.ClickListener() {
            @Override
View Full Code Here

        Table ptable = new Table();
        for (int colcount = 0; colcount < NUMBER_OF_COLS; colcount++) {
            String col = "COL_" + colcount + "";
            ptable.addContainerProperty(col, String.class, "--");
            ptable.addItem(colcount + "-").getItemProperty(col)
                    .setValue("--" + colcount + "");
        }
        ptable.setSelectable(true);
        ptable.setMultiSelect(true);
        ptable.setColumnReorderingAllowed(false);
View Full Code Here

        t.addContainerProperty("test3", String.class, "");
        t.addContainerProperty("test4", String.class, "");
        t.setWidth("100%");
        t.setHeight("300px");
        for (int i = 0; i < 100; i++) {
            Item item = t.addItem(i);
            item.getItemProperty("test1").setValue("testing1 " + i);
            item.getItemProperty("test2").setValue("testing2 " + i);
            item.getItemProperty("test3").setValue("testing3 " + i);
            item.getItemProperty("test4").setValue("testing4 " + i);
        }
View Full Code Here

        table.addContainerProperty("Column 1", String.class, "");
        table.addContainerProperty("Column 2", Component.class, "");
        table.addContainerProperty("Column 3", Component.class, "");
        table.addContainerProperty("Column 4", Component.class, "");

        Item item = table.addItem("Item 1 (row 1)");
        item.getItemProperty("Column 1").setValue("String A");
        item.getItemProperty("Column 2").setValue(new Label("Label A"));
        item.getItemProperty("Column 3").setValue(
                new Label("<b>Label A</b>", ContentMode.HTML));
        VerticalLayout l = new VerticalLayout();
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.