...
The configuration needs to be done in the following places:
- On the specific menu item on a given page
- On the data send out from the backend
...
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"/> <open id="CreateOrder" dataMember="showCreateOrder" *enabled="OnEmptyListUtilizingDataMember"*/> // Setting the enabled state of the menu item, will display it when no data is present. < </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> |
...
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.
From version 1.8.1, by setting *enabled="OnEmptyListUtilizingDataMember"* on the menu item it self will enable the data driven menu item when no data is loaded.
A data element could look as follows.
...