Action on listbox item click

I have a listbox with items and I want to have an action done, when i click on a listbox item. But I don’t know how to do that.




public void setFriendsList() {

friendslistbox.insertItem(“Friend1”, 0);

friendslistbox.insertItem(“Friend2”, 1);

friendslistbox.insertItem(“Friend3”, 2);

friendslistbox.insertItem(“Friend4”, 3);

friendslistbox.insertItem(“Friend5”, 4);

friendslistbox.insertItem(“Friend6”, 5);


Can someone help me? Thanks

EventBus Notification

The ListBox supports EventBus notification for any action that changes the selection of the ListBox. In that case an instance of ListBoxSelectionChangedEvent is published using the id of the ListBox as the Topic for the Event.


EventBus notifications are explained here: