I am designing a SAP UI5 Application which has 2 XML and 1 HTML view.I want to navigate to a HTML View from XML view on click of a button. How can i set routing for this.
Below code is not working:
routing: {
config: {
routerClass: "sap.m.routing.Router",
viewType: "XML",
viewPath: "executive.WebContent.view",
controlId: "app",
controlAggregation: "pages",
},
routes: [{
"pattern": "",
"name": "View1",
"viewPath": "executive.WebContent.view",
"viewType": "XML",
"target": "View1"
},
{
"pattern": "Login",
"name": "View2",
"viewPath": "executive.WebContent.view",
"viewType": "XML",
"target": "View2"
},
{
"pattern": "Visitor",
"name": "View3",
"viewPath": "executive.WebContent.view",
"viewType": "HTML",
"target": "View3"
}
],
targets: {
"View1": {
"viewName": "Main"
},
"View2": {
"viewName": "Login"
},
"View3": {
"viewName": "Visitor"
}
}
}
Let me know, solution for this.
As far as I see you are defining a global type XML in the config part of your routing; this will cause a conflict in your routes.
I tried to do what you are trying to do right now. But, I found an alternative solution. You can have a third XML view and inside the XML you can embed your HTML view. something like this:
<mvc:HTMLView id="nestedViewhtmnl"
viewName="executive.WebContent.view"
controller="executive.controller.xx" type="HTML"></mvc:HTMLView>
I hope this helps you =)
Thanks David for alternative solution but let me know, if there is direct solution (not workaround) for above issue
@JohnSmith stackoverflow.com/a/65629199/5846045