PDA

View Full Version : deselect() in StoreSelectionModel donīt work



nuno.ferreira
21 Dec 2011, 9:05 AM
Hello, i have this piece of code to deselect a selected item in grid



if (list.getSelectionModel().getSelectedItem() != null) {
list.getSelectionModel().deselect(list.getSelectionModel().getSelectedItem());
}


This donīt work, throws an exception - java.lang.IndexOutOfBoundsException: Index: 0, Size: 0.
Does anyone have a solution to this problem?

Sorry for my english.

nuno.ferreira
3 Jan 2012, 3:14 AM
Hi, the problem has discovered, the problem was at the event "OnSelectionChanged" that is triggered when selecting and deselecting an item. I have to validate if the list have elements on the event "OnSelectionChanged".

Sorry for the mistake ;)