This first started as a forum thread but I think that an Idea will get a bit more traction: https://www.outsystems.com/forums/discussion/60035/reactive-keep-submenu-open-after-selection/?utm_source=community&utm_medium=email&utm_campaign=forum-reply=#Post249116
The Idea
I have a menu that contains a Submenu. This is implement as shown below;
Whenever I open the submenu and click on one of it's items the page opens but the submenu closes. I rather want it to stay open.
Note that having it open by default is no issue, that's simply by adding the css class "open" to the ExtendedClass parameter. And I could of course create a whole elaborate mess of client actions and local variables to detect if I need to add the "open" class to the submenu but I was wondering if there is a nicer and cleaner method for this?
Please note that by adding this "open" class to the submenu you get a nasty flicker. After moving to a new page the submenu is being closed by the platform only to be opened again by the CSS class. This leads to a series of animations that looks real ugly.
Demo: https://vkoning.outsystemscloud.com/LeafletJSReactiveDemo/EventsToggleEventsDownload: https://www.outsystems.com/forge/component-overview/6907/leafletjs-reactive
note: No, this is not an advertorial in disguise. I really want to have a nice and clean solution for this problem and this application has and easy to share behavior of my issue.
Hi guys!
Just to add some thoughts on this, like I said in the forum topic, this should be something that we can control with a parameter.
This can also be something that can be more automatic based on the .layout-top / .layout-side classes, but if I want to make a custom layout I should be able to define the behaviour of the submenu.
.layout-top
.layout-side
Cheers!
Hi Vincent,
You can do an aggregate with maintain the current state to query on the sub-menu and put the result on a List on your menu.
Thanks.
Hi Vijayan,
My main issue is that the behavior of the menu differs on this front in regards to Web Traditional. From my perspective I should be able to tell a screen (of the menu component inside it) which menu item to expand and/or highlight. This is currently not the case. This should not be something where I, as developer, should jump trough hoops to solve it. This is something that should be solved on a platform level, it's low-code after all. These are things I don't need nor want to think about and if I need to think about these things that I don't want to need to create a complicated mess of data and actions to get this functionality up-and-running.
Greetings,
Vincent