Menu Designer
Menu Designer manages menu items in a given menu.xml configuration file.
The menu can be created in two modes:
- In the Composite mode the menu contains items from the project's
menu.xml
plus from the menu configuration files of all app components. This mode helps to easily include all inherited items and insert the project's specific items at any place of the menu structure. The inherited menu items can not be edited.
- In the Single mode the menu contains items from the project's
menu.xml
file only. In this case you need to create all items, including those existing in the app components if necessary, but you have full control over the menu structure.
The list of menu configuration files is defined by the cuba.menuConfig application property, which is updated when you select the mode.
In order to add a menu item, select an existing item (or the configuration file to create a top-level item) and click New. The Menu item editor window will be opened in a modal window.
You can create three types of menu items:
- Screen - a menu item which opens an application screen.
- Menu - a menu item which contains other items (submenu).
- Separator - a horizontal line separating menu items.
You should specify the following properties for a Screen item:
- Id - an ID of screen that is opened by this menu item.
- Caption - a menu item caption. The Edit button opens the localization window where you should enter captions in languages available for the project. Menu captions are placed in the corresponding main message pack with keys in
menu-config.{item_id}
format, where {item_id} is the item identifier, which in this case equals to the ID of the screen being opened.
- Open type - defines whether the screen should be opened in a new tab or in a modal window (
NEW_TAB
or DIALOG
). NEW_TAB
is used by default.
- Shortcut - a keyboard shortcut which opens the screen. Possible modifiers (
ALT, CTRL, SHIFT
) are separated by a "-", for example ALT-C
.
- Insert before / Insert after - a menu item, before/after which you want to insert the current item. This property helps to combine the project menu items with the items inherited from the app components in the Composite mode. For example, if you want to place your menu structure to the left of the Administration item, set
administration
in the Insert before field of the root item of your hierarchy.
- Params - screen parameters passed to the
init()
method of the opening screen's controller. See menu.xml for detailed explanation.
- Permissions - allows to restrict access to a menu item. If a user does not have permissions to access the item, it is not displayed. For detailed explanation see menu.xml, however there is a simpler way to manage access - through the Screens tab of the security role editor.
You need to specify the following properties for a Menu item:
- Id - an arbitrary unique ID of the item.
- Caption - same as for Screen item.
- Insert before / Insert after - same as for Screen item.