SideMenu
component provides means of customizing the main window layout, managing menu items, adding icons and badges and applying custom styles.
It can also be used in any screen as any other visual component. To add the SideMenu
component to the screen, you should add the xmlns:main="http://schemas.haulmont.com/cuba/mainwindow.xsd"
namespace to your screen descriptor.
XML name of the component: sideMenu
.
An example of component definition in an XML-descriptor of a screen:
link:../../../../../../source/gui_vcl/sidemenu.xml[role=include]
CUBA Studio provides the screen template for main window with the sideMenu
component and predefined styles within the side panel:
link:../../../../../../source/gui_vcl/sidemenu_default.xml[role=include]
sideMenu attributes:
Methods of the SideMenu interface:
SideMenu
component is used to display menu items. The MenuItem
API enables creating menu items in the screen controller. The methods below can be used for dynamic update of menu items depending on the application business logic. The example of adding a menu item programmatically:
link:../../../../../../source/gui_vcl/sidemenu_add.java[role=include]
Methods of the MenuItem interface:
- Attributes of sideMenu
-
align - caption - description - enable - height - icon - id - selectOnClick - stylename - tabIndex - visible - width
- Attributes of ftsfield
-
align - caption - description - enable - height - icon - id - stylename - visible - width
- API of sideMenu
- API of menuItem
-
addChildItem - removeChildItem - setBadgeText - setCaption - setCaptionAsHtml - setCommand - setExpanded - setIcon - setStyleName - setTestId