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.
sapui5 routing
SDD64
source share