PDA

View Full Version : [FIXED][2.0-trunk] Bug in Grid.reconfigure()



moldoe
11 Jun 2009, 11:29 AM
I have problems using Grid.reconfigure() to update dynamically columns and data of my grids. After I call reconfigure() the data rows shows up properly but the header columns not.
Here is a simplified example of the problem.

Windows XP
Hosted Mode
2.0-trunk



public class Test implements EntryPoint {

public void onModuleLoad() {

List<BaseModelData> data = new ArrayList<BaseModelData>();
BaseModelData rowData = new BaseModelData();
rowData.set("c1", "v11");
rowData.set("c2", "v21");
data.add(rowData);
rowData = new BaseModelData();
rowData.set("c1", "v21");
rowData.set("c2", "v22");
data.add(rowData);

MemoryProxy<List<BaseModelData>> dataProxy =
new MemoryProxy<List<BaseModelData>>(data);

ContentPanel contentPanel = new ContentPanel();
contentPanel.setLayout(new FitLayout());
final BaseListLoader loader = new BaseListLoader(dataProxy);
List<ColumnConfig> columns = new ArrayList<ColumnConfig>();
columns.add(new ColumnConfig("c1", "c1", 100));
final Grid grid = new Grid(new ListStore(), new ColumnModel(columns));
contentPanel.add(grid);
contentPanel.setSize(400, 400);

contentPanel.setBottomComponent(new Button("Load", new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
List<ColumnConfig> columns = new ArrayList<ColumnConfig>();
columns.add(new ColumnConfig("c1", "c1", 100));
columns.add(new ColumnConfig("c2", "c2", 100));
grid.reconfigure(new ListStore(loader), new ColumnModel(columns));
loader.load();
}
}));

Viewport viewport = new Viewport();
viewport.add(contentPanel);
RootPanel.get().add(viewport);
}
}
Is this a bug or should I use it differently?

Thanks,

Daniel

sven
11 Jun 2009, 11:33 AM
Which version of the trunk are yuo using? If posting bugs for a SVN version please also post the revisionnumber.

moldoe
11 Jun 2009, 11:36 AM
It's revision 1528.

Daniel

darrellmeyer
11 Jun 2009, 2:09 PM
Fixed in 2.0 M3 which is now available.