Skip to Content
SAP Visual Business

UI5 Development: Raising a Context Menu

Tags:

If the user requests a context menu, the application will receive an event and can send the following json to Visual Business to show the context menu directly.


{
   "SAPVB": {
      "xmlns:VB": "VB",
      "version": "2.0",
      "Menus": {
         "Set": {
            "name": "DynContextMenu",
            "Menu": {
               "action": "FCODE_SELECT",
               "askServer": "true",
               "id": "CTM1",
               "name": "DynContextMenu",
               "MenuItem": [
                  {
                     "accelerator": "C",
                     "active": "true",
                     "disabled": "",
                     "icon": "",
                     "id": "CREATE_SPOT",
                     "text": "Create Spot at position"
                  },
                  {
                     "accelerator": "C",
                     "active": "true",
                     "disabled": "",
                     "icon": "",
                     "id": "PERI",
                     "text": "Create perimeter",
                     "MenuItem": [
                        {
                           "accelerator": "1",
                           "active": "true",
                           "disabled": "",
                           "icon": "",
                           "id": "CREATE_GEOCIRC_1",
                           "text": "1 km"
                        },
                        {
                           "accelerator": "1",
                           "active": "true",
                           "disabled": "true",
                           "icon": "",
                           "id": "CREATE_GEOCIRC_2",
                           "text": "10 km"
                        },
                        {
                           "accelerator": "1",
                           "active": "true",
                           "disabled": "",
                           "icon": "",
                           "id": "CREATE_GEOCIRC_3",
                           "text": "100 km"
                        }
                     ]
                  },
                  {
                     "accelerator": "C",
                     "active": "true",
                     "disabled": "",
                     "icon": "",
                     "id": "COPY_POSITION",
                     "text": "Copy Geo-position"
                  },
                  {
                     "Separator": {
                     }
                  },
                  {
                     "accelerator": "I",
                     "active": "true",
                     "disabled": "",
                     "icon": "",
                     "id": "ITEM1",
                     "text": "Item 1"
                  },
                  {
                     "accelerator": "I",
                     "active": "true",
                     "disabled": "",
                     "icon": "",
                     "id": "ITEM2",
                     "text": "Item 2"
                  },
                  {
                     "Separator": {
                     }
                  },
                  {
                     "accelerator": "S",
                     "active": "true",
                     "disabled": "",
                     "icon": "",
                     "id": "",
                     "text": "Sub Menu",
                     "MenuItem": [
                        {
                           "accelerator": "S",
                           "active": "false",
                           "disabled": "",
                           "icon": "",
                           "id": "SUBITEM1",
                           "text": "Sub Item 1"
                        },
                        {
                           "accelerator": "S",
                           "active": "true",
                           "disabled": "",
                           "icon": "",
                           "id": "SUBITEM2",
                           "text": "Sub Item 2"
                        },
                        {
                           "accelerator": "S",
                           "active": "true",
                           "disabled": "",
                           "icon": "",
                           "id": "",
                           "text": "Sub Sub Menu",
                           "MenuItem": [
                              {
                                 "accelerator": "S",
                                 "active": "true",
                                 "disabled": "",
                                 "icon": "",
                                 "id": "SUBSUBITEM1",
                                 "text": "Sub Sub Item 1"
                              },
                              {
                                 "accelerator": "S",
                                 "active": "true",
                                 "disabled": "",
                                 "icon": "",
                                 "id": "SUBSUBITEM2",
                                 "text": "Sub Sub Item 2"
                              }
                           ]
                        },
                        {
                           "accelerator": "S",
                           "active": "true",
                           "disabled": "",
                           "icon": "",
                           "id": "SUBITEM3",
                           "text": "Sub Item 3"
                        }
                     ]
                  },
                  {
                     "accelerator": "I",
                     "active": "true",
                     "disabled": "",
                     "icon": "",
                     "id": "ITEM3",
                     "text": "Item 3"
                  },
                  {
                     "accelerator": "S",
                     "active": "true",
                     "disabled": "",
                     "icon": "",
                     "id": "",
                     "text": "Sub Menu 2",
                     "MenuItem": [
                        {
                           "accelerator": "S",
                           "active": "true",
                           "disabled": "",
                           "icon": "",
                           "id": "SUBITEM1",
                           "text": "Sub Item 1"
                        },
                        {
                           "accelerator": "S",
                           "active": "true",
                           "disabled": "",
                           "icon": "",
                           "id": "SUBITEM2",
                           "text": "Sub Item 2"
                        },
                        {
                           "accelerator": "S",
                           "active": "true",
                           "disabled": "",
                           "icon": "",
                           "id": "",
                           "text": "Sub Sub Menu",
                           "MenuItem": [
                              {
                                 "accelerator": "S",
                                 "active": "true",
                                 "disabled": "",
                                 "icon": "",
                                 "id": "SUBSUBITEM1",
                                 "text": "Sub Sub Item 1"
                              },
                              {
                                 "accelerator": "S",
                                 "active": "true",
                                 "disabled": "",
                                 "icon": "",
                                 "id": "SUBSUBITEM2",
                                 "text": "Sub Sub Item 2"
                              }
                           ]
                        },
                        {
                           "accelerator": "S",
                           "active": "true",
                           "disabled": "",
                           "icon": "",
                           "id": "SUBITEM3",
                           "text": "Sub Item 3"
                        }
                     ]
                  },
                  {
                     "Separator": {
                     }
                  },
                  {
                     "accelerator": "P",
                     "active": "true",
                     "disabled": "",
                     "icon": "",
                     "id": "Pers",
                     "text": "Personalize",
                     "MenuItem": [
                        {
                           "accelerator": "S",
                           "active": "true",
                           "disabled": "",
                           "icon": "",
                           "id": "VBI_PERS_STORE_SCENE_POS",
                           "text": "Set Initial Map Section"
                        },
                        {
                           "accelerator": "C",
                           "active": "true",
                           "disabled": "",
                           "icon": "",
                           "id": "",
                           "text": "Choose Map Type",
                           "MenuItem": [
                              {
                                 "accelerator": "D",
                                 "active": "true",
                                 "disabled": "",
                                 "icon": "",
                                 "id": "VBI_PERS_MLS_1",
                                 "text": "Demo for ALK Map"
                              },
                              {
                                 "accelerator": "D",
                                 "active": "true",
                                 "disabled": "",
                                 "icon": "",
                                 "id": "VBI_PERS_MLS_2",
                                 "text": "Default Map Layer Stack - MapQuest OSM"
                              },
                              {
                                 "accelerator": "H",
                                 "active": "true",
                                 "disabled": "X",
                                 "icon": "",
                                 "id": "VBI_PERS_MLS_3",
                                 "text": "HERE Standard Map *"
                              },
                              {
                                 "accelerator": "H",
                                 "active": "true",
                                 "disabled": "",
                                 "icon": "",
                                 "id": "VBI_PERS_MLS_4",
                                 "text": "HERE Fleet Map"
                              },
                              {
                                 "accelerator": "H",
                                 "active": "true",
                                 "disabled": "",
                                 "icon": "",
                                 "id": "VBI_PERS_MLS_5",
                                 "text": "HERE Hybrid Map"
                              },
                              {
                                 "accelerator": "H",
                                 "active": "true",
                                 "disabled": "",
                                 "icon": "",
                                 "id": "VBI_PERS_MLS_6",
                                 "text": "HERE Satellite Map"
                              },
                              {
                                 "accelerator": "H",
                                 "active": "true",
                                 "disabled": "",
                                 "icon": "",
                                 "id": "VBI_PERS_MLS_7",
                                 "text": "HERE Terrain Map"
                              },
                              {
                                 "accelerator": "O",
                                 "active": "true",
                                 "disabled": "",
                                 "icon": "",
                                 "id": "VBI_PERS_MLS_8",
                                 "text": "OpenCycleMap"
                              }
                           ]
                        },
                        {
                           "accelerator": "D",
                           "active": "true",
                           "disabled": "",
                           "icon": "",
                           "id": "VBI_PERS_DELETE_PERS",
                           "text": "Delete Personalization"
                        }
                     ]
                  }
               ]
            }
         }
      }
   }
}

No comments