SideMenu stylename "c-sidemenu-open" is removed after MenuItem click


I’m currently implementing a sidemenu using a sideMenuToggleButton. What I’ve realized is that, after a menuitem click the stylename “c-sidemenu-open” (HaloTheme.SIDEMENU_PANEL_OPEN) is removed and therefore the sidebar is closed.

The relevant classes are WebSideMenu and CubaSideMenu:


I would like to keep the sidemenu opened after menuitem click. How can I keep the stylename “c-sidemenu-open”? Or what is the intention of the sidemenu toggle button?

Thx and regards,


SideMenu with responsive styles is intended to correctly show menu in small screen devices. The default behavior is closing side panel when we click on a menu item because in small screen devices this panel takes a lot of space. Such behavior is the same as in Android and Polymer.

If you don’t want to close panel by click on menu item, you can extend WebSideMenu component:

public class SideMenuExt extends WebSideMenu {

    public SideMenuExt() {
        // set null or specific logic

In order to use your extended component in all application you need to create ui-component.xml in the root package in web module:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<components xmlns="">

And in the file define following property:

cuba.web.componentsConfig = +com/company/demo/ui-component.xml

The whole sample you can see in the demo project: (76.4 KB)

thank you very much :grin: Now I see how it works.