on 03-26-2015 8:24 AM
Hi,
I have created multiple views in my sap.ui.commons application.
and looking for solution, where I can switch from one view to another view.
just the same way, we do in sap.m.app with .TO / .BACK functionality.
Please guide me how to achieve it.
Note: Application is created with Java Script option.
Regards,
Praveer.
Hi Praveen,
This thread might help you:
1. I use a container, e.g. a ux3 shell, and I add the desired view to it, and change it when I want to see another view.
index.html
- var oShell = new sap.ui.ux3.Shell({
- id: "shell",
- });
- var loginView = sap.ui.view({
- id: "loginView",
- viewName : "viewt.Login",
- type: sap.ui.core.mvc.ViewType.JS
- });
- var listView = sap.ui.view({
- id: "listView",
- viewName : "view.List",
- type: sap.ui.core.mvc.ViewType.JS
- });
- oShell.addContent(sap.ui.getCore().byId("loginView"));
e.g. when login is successfull: view.Login.js
oShell.setContent(sap.ui.getCore().byId("listView"));
Regards,
RW
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Praveer,
in sap.ui.commons also u can do navigation lik sap.m.app.
but for sap.ui.commons here is the code.
1st view to 2nd view,
var oShell= sap.ui.getCore().byId("idShell");
oShell.removeAllContent();
var secondview = sap.ui.view({id :"idinvdtl1", viewName :"com.arteriatech.ppd.invoicelst.InvDtl.invdtl", type:sap.ui.core.mvc.ViewType.JS});
oShell.addContent(secondview);
back to 1st view,
var oShell= sap.ui.getCore().byId("idShell");
var firstview= sap.ui.getCore().byId("firstViewId");
oShell.removeAllContent(firstview);
firstview.destroy();
oShell.addContent(firstview);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.