Maintaining the state of widgets that are placed in layouts is very high on our backlog. The idea is to only replace the parts of the page that have changed. This would fix the "active class" problem, but also the fact that, for example, a tree widget collapses when you navigate to a different page.
We had the same issue. Solution was to create seperate snippets and layouts for each navigation item. Would be great if modeler would support active states!
@Charles: yeah, but when you use sub navigation even that is not really an option.
In the mean time I've developed a widget that does this. Anyone interested can contact me via www.appronto.nl/contact/
I'm trying to create a widget for this. For the tree menu it works fine because the tree menu is available in the DOM when executing the post create function of the widget.
The default (horizontal) menu gives a problem. It seems that in the postCreate of the widget the menu ul and li structure is not build. The only thing available in the postCreate is this:
<div data-mendix-id="13871" data-mendix-type="mxui.widget.Navbar" data-mendix-props=""menuID":"159b6aef-dbc3-5b23-a735-cf99f8341771"" class="menu-1"></div>
The tree menu does have list content, the Navbar doesn't. Anyone ideas? If I can accomplish that the widget is executed after the menu has content than I can complete a widget that set active CSS class for active menu items.
I am encountering the same issues when I use the vertical navigation,does anyone know if this has been fixed in newer versions of mendix?
Bumping this. I have an older project where the "active" class is being applied to the menu item but not on newer projects. The older one is in 6.10.2, the newer one is in 7.2.0.