I've been trying to use listeners on gluon CharmListView
for a while. It didn't work in my project so i decided to try it on the FIFTY STATES app. I added the code below:
charmListView.onMouseClickedProperty().set((MouseEvent event) ->{
Logger.getGlobal().log(Level.INFO, "Pick: {0}", new Object[]{event.getPickResult()});
});
When I launch the application, NO click fires aMOUSE_CLICKED
event. When I scroll down slightly such that the a list header cell is fully docked like this,
the CharmListView
fires the event only on a click on the top header cell.
INFO: Pick: PickResult [node = VBox@49f31558[styleClass=text-box], point = Point3D [x = 133.0, y = 13.0, z = 0.0], distance = 1067.366530964699
No other click anywhere else on the list fires an event.
I've tried adding the same listener to the normal ListView
and a MouseEvent
is always fired after a click on any area of the ListView
. So now I'm stuck because I cannot set a listener to get a selected item.