Dynamic Menu

SmartDevicesPlus provide the possibility to implement a Dynamic Menu (with icons or not) in a simple way. Below is explained how to achieve this.

Step 1 : Create a SD Panel based on an SmartDevicesPlus menu Template

DynamicMenuImg01

As a example, let´s select the template "Menu with banner".

DynamicMenuImg02

Step 2: Modify the Data Provider 'SDPDynamicMenuDP'

The menu is loaded by a Data Provider which is called 'SDPMenuOptions' . In the Source section of it, there is a sample code that you can follow to load each item of the Menu.

DynamicMenuImg03

Each Item has the following lines:

  • Title: specifies the text that is shown in the item of the menu
  • Icon: specifies the image that is shown next to the title 
  • ComponentToCall: specifies the component which will be called when the user select the item of the menu. 
    The syntax of the call is as follows: !"sd:<COMPONENT>?<PARAMETER>"
    For more information of the way to call object go to the following link: Dynamic Calls
  • Type: specifies the style of the item within the menu, as it may have a line as separator or not or can be shown as a link:

DynamicMenuImg08

If you have selected a template that displays the User data, you should also load the SDPMenuInfoDP Data Provider as follows:

DynamicMenuImg07

Step 3: Add each component call in the 'Compilation Dummy' event

It's necessary to add in the event 'CompilationDummyEvent' of the SD Panel the call of the Objects that you have added in the menu.

DynamicMenuImg04

Step 4: Set the SD Panel as 'Startup Object'

DynamicMenuImg05

At runtime will look as follows:

DynamicMenuImg06