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 37 38 39 40 41
| public ArrayList<List<String>> rows = new ArrayList<List<String>>();
ListDataProvider<List<String>> provider;
//...
public widget ....
// fill the rows
//add the IndexedColumn
table.setRowCount(rows.size(), true);
table.setRowData(0, rows);
provider = new ListDataProvider<List<String>>(rows);
provider.addDataDisplay(table);
//...
// Save handler
if (item.getText() == "Save") {
int i=0;
provider.refresh();
while(i<table.getRowCount()){
System.out.println(provider.getList().get(i)); // Ici, je ne vois que les lignes de base, sans modification. Comment cela se fait?
i=i+1;
}
}
class IndexedColumn
// Method to add column dynamically to the table
class IndexedColumn extends Column<List<String>, String> {
private final int index;
public IndexedColumn(int index) {
super(new EditTextCell());
this.index = index;
}
@Override
public String getValue(List<String> object) {
return object.get(this.index);
}
} |
Partager