PDA

View Full Version : retrieve index of selected TreeItem



rian.k
25 May 2009, 11:44 PM
Allright, I got a tree with SelectionModel.SINGLE. Now, in the following code, why am I always getting -1 for index?


binder.addSelectionChangedListener(new SelectionChangedListener<TreeModel>() {
public void selectionChanged(SelectionChangedEvent<TreeModel> event) {
TreeModel tm = event.getSelectedItem();
int index = tree.indexOf(tree.getSelectedItem());
}
});thanks