Available from v. 1,5,11
...
Info | ||
---|---|---|
| ||
|
Description
Excerpt |
---|
Show or hide menu items (actions |
Page menus are statically created and consist of page-specific and custom menu items.
Data-driven menu items , takes this to another level, where data on a page can control which items are enabled, and which are not, as well as which ones are promoted.
The data can be either orders, order lines or lookup -results.
Functionality
You can control the following on the menu item
- visible - Shown or hidden
- promoted - Promoted and the order among promoted items
- enabled - Selectable or grayed-out
Mobile Configuration
The configuration needs to be done in two places.:
- On the specific menu item on a given page.
- On the data send out from the backend.
...
Page Configuration
...
Example
Open and ItemCrossReference menu items are set to be controlled by a data member.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<page id="Receive" type="OrderList" icon="mainmenureceive"> <title defaultValue="@{PageReceiveOrderListTitle}" /> <orderListConfiguration automaticOrderSelectionAfterFilter="true"> ... <list listId="Orders"> <!-- The enabled attribute is disregarded when the dataMember is setup. --> <open enabled="true" *dataMember="showOpenMenu"*/> </list> ... </orderListConfiguration> <actions> ... <open id="ItemCrossReference" dataMember="showCustomMenuItem"/> </actions> <!-- IMPORTANT: If the dataMember property is set on any menu item, defining number of promoted items here will be ignored. --> <menu numberOfPromotedItems="1"/> </page> |
...
The configuration needed on each individual data element , consists of a new xml XML element named menuItemStateConfigurations, that which can contain an arbitrary list of elements that sum up the data members available for that given data element.
The element naming is up to the individual implementation , and just needs to match the name set in the dataMember="" attribute on the given menu item.
Valid attributes on the data member elements are as follows.
- promoted - Promoted and the order among promoted - Dictates that the menu item should be promoted, and the order in which it appears.enabled - Dictates if the menu item can be selected or if it is grayed outitems
- enabled - Selectable or grayed-out
Visibility
An important note is that if a menu item references a specific data member, and that data member is not present in the data, then the menu item will not be visible.
So the way to control the visibility of a data member-controlled menu item is to have the reference data member included in the data or not.
A data element could look as follows.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<baseOrderLine> ... <menuItemStateConfigurations> <!-- The element containing all menu item configurations. --> <showOpenMenu promoted="1" enabled="true"/> <!-- Show the menu item as the first promoted element and enabled. --> <showCustomMenuItem promoted="2" enabled="false"/> <!-- Show the menu item as the second promoted item, and make it disabled. --> </menuItemStateConfigurations> </baseOrderLine> |
Filter by label (Content by label) | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|