Application Menu

Application Menu Definition

Application menu is defined using <application.shortName>.menu file.


<?xml version="1.0" encoding="UTF-8"?>
<!-- expanded with nsx-expanders:4.13.0-SNAPSHOT, expansionResource net.democritus:Expanders:4.13.0-SNAPSHOT -->
<navigation xmlns="">
    <!-- anchor:components:start -->
    <component name="utils"/>
    <component name="demoBooking"/>
    <!-- anchor:components:end -->


    <!-- @anchor:menus:start -->
    <!-- @anchor:menus:end -->
    <!-- anchor:custom-menus:start -->
    <menu profile='admin'>
      <submenu name='Booking'>
        <menuitem ref='demoBooking-airport-list-page'/>
        <menuitem ref='demoBooking-person-list-page'/>
      <submenu name='Config Data'>
        <menuitem ref='demoBooking-person-list-page'/>
        <menuitem ref='demoBooking-airline-list-page'/>
        <menuitem ref='demoBooking-location-list-page'/>
    <menu profile="user">
      <submenu name="Booking">
        <menuitem ref='demoBooking-person-list-page'/>
        <menuitem ref="demoBooking-passenger-list-page"/>
    <menu profile="default">
      <submenu name="Flights">
        <menuitem ref="demoBooking-flight-list-page"/>
    <!-- anchor:custom-menus:end -->
    <!-- anchor:default-complete:start -->
    <menu profile="default-complete">
      <submenu name="Utils">
        <menuitem ref="utils-execution-list-page"/>
        <menuitem ref="utils-idCounter-list-page"/>
        <menuitem ref="utils-paramTargetValue-list-page"/>
        <menuitem ref="utils-tagValuePair-list-page"/>
        <menuitem ref="utils-thumbnail-list-page"/>
      <submenu name="DemoBooking">
        <menuitem ref="demoBooking-airport-list-page"/>
        <menuitem ref="demoBooking-booking-list-page"/>
        <menuitem ref="demoBooking-flight-list-page"/>
        <menuitem ref="demoBooking-passenger-list-page"/>
    <!-- anchor:default-complete:end -->


The file consists of menus with a profile attribute (in the example above: admin, user, default, default-complete).

When using the account component, the profileName of the current user is used. For JavaEE, the first profile defined in the menu file that the user has role of.

If no such profile in the menu exists, two fallbacks are used.

You can add a "default" profile to the custom-menus anchor. This will be used if the above selection hasn’t matched anything.

The menu also contains "default-complete" profile (starting with Expanders v4.13.0/default-stack v2021.1.0). This profile is not customizable, but contains all applicable components and dataElements. It’s main purpose is for debugging and quick iteration during development.

  • title title of the menu, usually the name of the element
  • selector where to inject the menu
  • menuName name of the .menu file
  • view reference to the html template for the menu
var Menu = require('nsx/menu');
  title: "...",
  selector: "menu",
  menuName: "...",
  view: menuTemplate