How to Optimize Multiple SAPUI5 Apps in One Dashboard: Step by step Guide
Mohammad Sohail Khan
SAP BTP Consultant | SAPUI5 & Fiori | CAP | Workflow | Cloud Foundry | MDK | S4HANA Cloud | Node.js | Build Apps | SAP Certified ?
To combine multiple SAPUI5 applications with separate functionalities into a single dashboard, you need a well-structured architecture that ensures seamless integration, scalability, and maintainability. Here is an overview of how to manage this architecture:
Modular Architecture
Lets get started
First will create a fresh project called name Demo
Note: you will find github link at the end of blog.
To add a Shell bar (which serves as the Dashboard) in your SAPUI5 application, you should modify the App.view.xml file. This approach ensures that the Shell bar is a common component rendered for every controller.
Now if you see in the above image in the code editor you see line number 38 <tnt:sideContent/> it is responsible for side navigation list to make it dynamic will add a json data in model folder and declare as globally in manifest.json>model
Now will generate Fragment using npm i ui5-route-generator
We need show side navigation list so once we add fragment we need to bind that fragment in app.view.xml inside <tnt:sideContent/>
my path is "sohail9744.demo.fragment.SideNavigation" if you are not able to find your path simple go on the top of your App.view.xml you will find like this below (you can see the controllerName the above to words is your directory path .controller or .fragment is your rest path)
<mvc:View
controllerName="sohail9744.demo.controller.App"
xmlns:html="https://www.w3.org/1999/xhtml"
xmlns:mvc="sap.ui.core.mvc"
displayBlock="true"
Now assume in side navigation list every name is having there separate apps now will divide into components how we use to do in react.
领英推荐
Now it's time to configuring routing for this pages go to manifest.json file
In the App.controller.js you need code and paste this below code
sap.ui.define(
[
"sap/ui/core/mvc/Controller",
"sap/ui/core/UIComponent"
],
function (BaseController, UIComponent) {
"use strict";
return BaseController.extend("sohail9744.demo.controller.App", {
onInit: function () {
this.router = UIComponent.getRouterFor(this)
},
onMenuButtonPress: function () {
let toolPage = this.byId('toolPage')
toolPage?.setSideExpanded(!toolPage?.getSideExpanded());
},
onItemSelect: function (ev) {
let item = ev.getParameter('item').getKey();
this.router.navTo(item)
}
});
}
);
Hurreeeee:) Now everyting is completed it will work if you read all blog.
Live application Demo Example: Link
You can Clone from Github https://github.com/sohail9744/ui5boilerplate
git clone https://github.com/sohail9744/ui5boilerplate.git