Showing dynamic numbers in Navigation Items

0
Hi Everyone,   We have one requirement to show the number of notifications in bracket when a user logs in.  Since this Notification is loading from Navigation pane we are unable to show the dynamic test there. To solve this problem we wrote on js and updated the label of navigation item. Though this approach is working, we are facing different issues and we need to disable the JS. Apart from updating this lable from JS does anyone has an alternative solution.
asked
1 answers
1

Based on my research, Mendix does not support dynamically updating a navigation item label at runtime. Since the navigation document is static, it’s not possible to safely bind a label like “Notifications (3)” after login. While DOM manipulations via JavaScript may work in the short term, they can become fragile and lead to UI issues after Mendix/Atlas updates or in different theme and browser scenarios.

 

A more robust approach is to handle this at the layout level instead of the navigation item itself. A separate “Notifications” area can be placed in the same region as the menu and styled with the same CSS so it visually behaves like a menu item. The notification count can then be calculated after login or via specific triggers and bound through a non-persistent object or datasource. This avoids the need for JavaScript, stays within Mendix-supported patterns, and results in a more stable long-term solution.

answered