Notifications question: is there a click event buried somewhere?

I’m wondering if there’s a way to have an event happen when a user click on a notification. In our specific case we are using the User Inbox add-on and I’ve done some extension of some classes and have a notification shown when a logged-in user gets a new message (because the extended MessageServiceBean uses the Global Events add-on to publish an event when the message is sent)… I’d like to have a user be able to go right to the message if they click on the notification.

I’m not finding a way to do it, I would think something like .withClickListener() or similar would be present, but it’s not.

Is this possible, or would it require a huge amount of class extension/etc?

(Or has it been done before?)

Hi @jon.craig,
Have you tried .withCloseListener() ?

Regards,
Peterson.

I have actually. The only useful method of the event sent seems to be isUserOriginated() and in my testing… it always returns true. If I let the noti “expire” on it’s own, iUO returns true and if I click on the noti to make it go away… it also returns true.

So… :frowning:

Hi @jon.craig,

Unfortunately, there is no ClickListener and its implementation will require you to extend both server-side and client-side implementations of Notification.

The reason why in both cases isUserOriginated() returns true is that in both cases notifications hide after user action either click or mouse movement.

Regards,
Gleb

That is unfortunate. :frowning:

Ah well.