SAPUI5: Is it possible to map a folder such as a structure to a list control in the form of sap.m Master?

I want to map a folder, such as a structure, to a list control in the main view of sap.m.

Please have a look at the demo app called Shopping Basket . You will see Master-> Master-> Detailed Navigation. From category to products (Product) Details.

I have already studied the source code. Top navigation is implemented using routing.

For my projects, I would like to have something like this. However, this would not be a simple structure M-> M-> D. My data would be obtained in JSON form from the folder structure of the SAP Enterprise Portal. Each folder may contain other folders or files. A data structure might like that, but it can have n folder levels:

{ "root": [ { "name" : "Folder A", "isCollection": true, "content" : [ { "name" : "Sub Folder A", "isCollection": true, "content" : [ {"filename":"IpsumPrimisIn.xls","datatype":"application/vnd.ms-excel"},{"filename":"IdOrnare.mp3","datatype":"audio/x-mpeg-3"} ] } ] }, { "name" : "Folder B", "isCollection": true, "content" : [ { "name" : "Sub Folder B", "isCollection": true, "content" : [ {"filename":"IpsumPrimisIn.xls","datatype":"application/vnd.ms-excel"}{"filename":"Non.mov","datatype":"video/quicktime"} ] } ] } ] } 

Please note that the folder structure will change and may become more diverse and deeper over time.

The ideal solution is to dynamically read, adapt and map the JSON structure to some SAPUI5 routing logic. Is it possible? Have an instance of Router, scroll through my JSON structure, call addRoute () and dynamically add the folder as a route ...

Note. I already know how to create a JSON structure based on SAP EP folders.

+7
sapui5 routing
source share
1 answer

This is my solution: Pass json to menu in Openui5 It works great!

Each time I click on a menu item, I call a controller function that opens a details page or creates a new menu value on a new main page each time.

0
source share

All Articles