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!
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!