How to update a snippet in the top-bar from a microflow?

0
Hello experts, Studio Pro 8.18.1 I am working on allowing users to request access to specific objects. The basics are working. People can request access, the admins can approve or reject. Everything works just fine. To give the users insight into the number of open requests I have added “(# pending requests)” the top-bar in the snippet that also shows the user's name: This also works. But the user needs to manually refresh/reload the page for this snippet to be updated. The microflow that is used to create request re-opens the page where the user triggered the request. Unfortunately this does not appear to update the top-bar. Can an update of the top-bar be triggered from a microflow (or another way), without the user needing the refresh/reload the page? regards, Marco
asked
3 answers
1

Have a look at the microflow timer widget in Mendix marketplace: https://marketplace.mendix.com/link/component/27. This widget allow triggering a microflow or nanoflow based on configurable intervals. Do not set the interval value to low to avoid spaming the server with XAS requests.

[EDIT]

The issue is that the data view in your page header is not refreshed on status change, but only on page load.

You can either:

  • refresh the data view in the page header when users request access. Then you would not need the Microflow Timer, but users would NOT be informed in case an admin approves (if this info would be shown to the users as well in the header)
  • put the microflow timer widget into the data view where the “pending requests” info resides, and add a refresh microflow or nanoflow that will just refresh the data view
  • Do both: then users would immediately see that there is a new pending request after they requested access, and they would be informed if an admin grants or rejects access

Hope this helps,

Thorsten

answered
0

Thanks for the tip, Thorsten.

I tried it but the snipped was not updated.

answered
0

Before:

The user can then click “I want access”. This updates the loaded page:

But only a refresh (F5) will update the header:

This header is a custom top-bar that shows the Navigation-menu. It also has a snippet call. This snipped shows the “Good afternoon, <user>” and the "(N pending request)” via their own data-view.

answered