PDA

View Full Version : CheckBoxListView does not appear respond to the SelectionChange event (GXT 2.2.5)



johnitab
20 Mar 2012, 1:11 PM
Hello -

I'm new to GXT (working with v2.2.5) and was attempting to work with the CheckBoxListView. After modeling my code after the demo code provided, I noticed that the component (or the underlying selection model) does respond to the SelectionChange event as documented. The demo doesn't seem to perform as expected.



view.getSelectionModel().addListener(Events.SelectionChange,
new Listener<SelectionChangedEvent<BeanModel>>() {
public void handleEvent(SelectionChangedEvent<BeanModel> be) {
panel.setHeading("CheckBox ListView (" + be.getSelection().size()
+ " items selected)");
}
});


I was successful at having the CheckBoxListView listen for the OnClick event as shown below:



view.addListener(Events.OnClick, new Listener<ListViewEvent<ModelData>>() {
public void handleEvent(ListViewEvent<ModelData> be) {
System.out.println("Clicked!");
}
});


I would appreciate it if someone would confirm/explain this behavior. I apologize in advance if this is a duplicate post.

Thanks!

harun
26 Mar 2012, 4:31 AM
Selected items are different from checked items in GXT. Firstly you must know this.

That list view example shows you selected items count .

you can easily see with pressing CTRL key and mouse click on the items.

johnitab
26 Mar 2012, 1:10 PM
I see. Thanks so much!!!