micgala
10 Jul 2009, 12:00 AM
Hi.
There is a problem when i try to use the reconfigure in a EditorGrid, and after that I try to edit a cell.
This is a test case. For getting the problem, click in the button for reconfiguring and adding an entry to the grid. Then try double clicking in a cell for editing. (Make sure the double click event in the cell is triggered!)
You will get a ArrayIndexOutOfBoundsException.
public void onModuleLoad() {
Window window = new Window();
window.setLayout(new FitLayout());
window.setSize(400, 300);
final ListStore<BaseModel> store = new ListStore<BaseModel>();
ColumnConfig test = new ColumnConfig("id", "Test", 200);
ColumnModel columnModel = new ColumnModel(Arrays.asList(test));
final EditorGrid<BaseModel> grid = new EditorGrid<BaseModel>(store, columnModel);
grid.setClicksToEdit(ClicksToEdit.TWO);
window.add(grid);
window.addButton(new Button("Add Data & Reconfigure", new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
ColumnConfig name = new ColumnConfig("name", "Name", 200);
ColumnConfig value = new ColumnConfig("value", "Value", 200);
ColumnModel columnModel = new ColumnModel(Arrays.asList(name, value));
BaseModel model = new BaseModel();
model.set("name", "Test");
model.set("value", "Value Test");
BaseModel model1 = new BaseModel();
model1.set("name", "Test1");
model1.set("value", "Value Test1");
store.add(model);
store.add(model1);
grid.reconfigure(store, columnModel);
}
}));
window.show();
}
Thanks for looking into this.
Regards,
Michel.
There is a problem when i try to use the reconfigure in a EditorGrid, and after that I try to edit a cell.
This is a test case. For getting the problem, click in the button for reconfiguring and adding an entry to the grid. Then try double clicking in a cell for editing. (Make sure the double click event in the cell is triggered!)
You will get a ArrayIndexOutOfBoundsException.
public void onModuleLoad() {
Window window = new Window();
window.setLayout(new FitLayout());
window.setSize(400, 300);
final ListStore<BaseModel> store = new ListStore<BaseModel>();
ColumnConfig test = new ColumnConfig("id", "Test", 200);
ColumnModel columnModel = new ColumnModel(Arrays.asList(test));
final EditorGrid<BaseModel> grid = new EditorGrid<BaseModel>(store, columnModel);
grid.setClicksToEdit(ClicksToEdit.TWO);
window.add(grid);
window.addButton(new Button("Add Data & Reconfigure", new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
ColumnConfig name = new ColumnConfig("name", "Name", 200);
ColumnConfig value = new ColumnConfig("value", "Value", 200);
ColumnModel columnModel = new ColumnModel(Arrays.asList(name, value));
BaseModel model = new BaseModel();
model.set("name", "Test");
model.set("value", "Value Test");
BaseModel model1 = new BaseModel();
model1.set("name", "Test1");
model1.set("value", "Value Test1");
store.add(model);
store.add(model1);
grid.reconfigure(store, columnModel);
}
}));
window.show();
}
Thanks for looking into this.
Regards,
Michel.