In the datatable view the event onAfterUnselect is not fired if a selection is removed by clearSelection();
This is by design. The onAfterUnselect event occurs only if you have unselected some specific row. In case of mass unselection this event is not triggered.
If you need to catch all cases of selection changing you can use onSelectChange event.
It looks like you're new here. If you want to get involved, click one of these buttons!