Reputation: 1
As I am a newbie to openui5, I can't navigate from one view to another view using a button click.
How do I do that? I searched a lot and I got frustrated. While searching mostly I got the data related to sap.m(mobile)
but I need code sample for sap.ui.commons(desktop)
or any other link would be helpful.
Can anyone share some sample code for sap.ui.commons
(Routing or tab navigation) not for sap.m
?
Upvotes: -1
Views: 2627
Reputation: 4225
Use Router of the SAPUI5 Application:
Sample code snippet :
var oRouter = sap.ui.core.routing.Router.getRouter("appRouter");
//can also use directly this.oRouter.navTo if you're extending scaffloding OR base controllers of SAP UI5.
oRouter.navTo("samplePattern",oContext,false);
Upvotes: 1
Reputation: 328
There are different options for this:
1.Option:
is to use the sap.ui.ux3.Shell
see here
2.Option:
using a Router
3.Option:
or by hiding a view and showing it like this:
sap.ui.getCore().byId('View1').setVisible(false);
sap.ui.getCore().byId('View2').setVisible(true);
Upvotes: -1