How to deal with page routing in SAP UI5 application
This article focuses on "how to deal with page routing in SAP UI5 applications". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to handle page routing in SAP UI5 applications.
Select the webapp folder of the SAP UI5 application, right-click, select New- > SAP UI5 View, and create a new UI5 view:
Change the name of the view to app:
Edit the route area in the manifest.json file, rename the default route to home, and clear the Pattern field
The destination of the route, set to another view in our UI5 application, View1:
Set the new view we just created to the root view of this application:
```JavaScript
Var oRouter = sap.ui.core.UIComponent.getRouterFor (this)
Var selectedProductId = oEvent.getSource () .getBindingContext () .getProperty ("ProductID")
ORouter.navTo ("Detail", {
ProductId: selectedProductId
});
`
Create a new Detail view:
Source code:
```xml
`
In the manifest.json file, create a new routing rule:
Pattern:detail/ {productId}
The route destination is Detail view and the view level is 2:
Run-time test, after I click on a list line item:
Jump to the details page:
At this point, I believe you have a deeper understanding of "how to deal with page routing in SAP UI5 applications". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!