PDA

View Full Version : Only first row in grid gets selected using GridSelectionModel



Donald
29 Aug 2009, 7:28 AM
CLOSED!
Problem was releated to a wrong equals - method on the BeanModel object presented in the grid.....


I am using GXT 2.0.1 and I have a problem selecting rows in a grid.

The following code snippet is used to handle selections. What happens is, that only the first row in the grid is selected when I click on the grid area. After that no selection is possible any more. Since this code is so simple and straightforward I am sure this must work. But what am I doing wrong?

Thanks,
Donald

final GridSelectionModel<BeanModel> csm = new GridSelectionModel<BeanModel>();
csm.setSelectionMode(SelectionMode.SINGLE);

grid.setSelectionModel(csm);
csm.addListener(Events.SelectionChange,
new SelectionChangedListener<ModelData>() {

@Override
public void selectionChanged(
SelectionChangedEvent<ModelData> se) {
BeanModel model = (BeanModel) se.getSelectedItem();
if (model != null) {
selected = model.getBean();
showSelectionDetails(selected);
}

}

});

Arno.Nyhm
31 Aug 2009, 4:26 AM
maybe there is some error thrown. did you check all log information?
what if you remove your showSelectionDetails?