Когда я добавляю table.addContainerProperty вручную (все они), он работает, добавляя все элементы, которые я запрашиваю.
Когда я использую для создания table.addContainerProperty, я не могу добавить значения с помощью своей кнопки, или с помощью которого следует добавить все мои значения.
Почему?Я нигде не могу его найти ...
package br.com.Metrics;
import com.vaadin.Application; import
com.vaadin.ui.Button; import
com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Table; import
com.vaadin.ui.Window;
import br.com.cflex.table.*;
/** * The Application's "main" class
*/ @SuppressWarnings("serial") public class MyVaadinApplication extends Application {
private Window window;
private Table table;
@Override
public void init()
{
window = new Window("My Vaadin Application");
table = new Table("Teste de tabela");
table.addItem();
table.addContainerProperty("Nome", String.class, null);
for(int i=0; i<10;i++){
table.addContainerProperty(i,Integer.class, null);
table.addItem(new Object[] {"2",new Integer(159),new Integer(1473)}, null);
}
for(int i=0; i<10; i++){
table.addItem(new Object[] {"3",new Integer(159),new Integer(1473)}, null);
}
table.addItem(new Object[] {"4",new Integer(159),new Integer(1473)}, null);
Button button = new Button("Press Me !");
button.addListener(new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
table.addItem(new Object[] {"Nicolaus",new Integer(159),new Integer(1473)}, null);
}
});
window.addComponent(table);
window.addComponent(button);
setMainWindow(window);
}
}