aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/itmill/toolkit/tests/tickets/Ticket1368.java
blob: b2f137ec8c11c61ad7f5e179d945875da0644198 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package com.itmill.toolkit.tests.tickets;

import com.itmill.toolkit.Application;
import com.itmill.toolkit.tests.TestForTablesInitialColumnWidthLogicRendering;
import com.itmill.toolkit.ui.ComboBox;
import com.itmill.toolkit.ui.Table;
import com.itmill.toolkit.ui.Window;

/**
 */
public class Ticket1368 extends Application {

    private Table t;

    @Override
    public void init() {

        final Window mainWin = new Window("Test app to #1368");
        setMainWindow(mainWin);

        t = TestForTablesInitialColumnWidthLogicRendering.getTestTable(3, 5);

        mainWin.addComponent(t);

        ComboBox addColumn = new ComboBox();
        addColumn.setImmediate(true);
        addColumn.setNewItemsAllowed(true);
        addColumn.setNewItemHandler(new ComboBox.NewItemHandler() {
            public void addNewItem(String newItemCaption) {
                t.addContainerProperty(newItemCaption, String.class, "-");
            }
        });
        mainWin.addComponent(addColumn);

    }
}