Refresh object in the browser without using a session

3
We have a challanging situation where the user has a counter of unread messages. This is saved in the account object and shown in the navigation layout. Because the navigation layout gets cached, the counter is not updated by default very often. This is why we would like to force a refresh of the account object when a new message is created. So that if the user is logged in, the counter will be instantly refreshed. Is this possible? Things we tried that didn't work: - Microflow timer widget that checks if the counter needs to be refreshed. This works perfect but breaks the requirement that the user needs to be logged out after 15 minutes of inactivity. Since the microflow timer widget always uses the session, the user will be active forever :) - Placing the counter in a non-persistent object and refresh it when the message is created Any idea is most welcome :)
asked
4 answers
3

I don't know a way to easily build this in Mendix at the moment.

You could build your own widget for showing the counter. For the widget generate a user token and use that token to regularly fetch the count via a REST service.

Just an idea...

answered
2

Jeroen,

I have used the Database Counter widget for requirements like this and it works great!  You can set refresh intervals and retrieve info from the database without a context refresh.

Hope that helps,

Mike

answered
1

Have you tried to make a scheduled event which checks if an user is online and when he or she is not active updates the counter? If the user is active it can be done in the active session.

answered
1

Jeroen,

Can't you make a deeplink to an anonymous page where you include a sort of  api key which you can use to identify the user and next you create a iframe which you include in your navigation?

Wouter.

answered