on 09-01-2015 10:37 AM
Hi ,
Just now i started UI5 Developments ,
i was doing shell, in the shell i created two work set items whenever i selected workset items its has call view but its giving error.
var oshell = new sap.ui.ux3.Shell({
appTitle: "NAPESCO",
showSearchTool: false,
content : [ new sap.ui.view (
{
id: "VIEW1", viewName : "expenserpt.exp_rpt",
type : sap.ui.core.mvc.ViewType.JS
}
)],
worksetItems: [
new sap.ui.ux3.NavigationItem("FI",{
key: "FI",
text: "Finace",
subItems:[
new sap.ui.ux3.NavigationItem("EXP",{Key:"EXP",text:"Expense Report"})
]
}),
new sap.ui.ux3.NavigationItem("OFS",{
key: "OFS",
text: "OFS(Oil Field Service)",
subItems:[new sap.ui.ux3.NavigationItem("OFS_1",{Key:"RIG",text:"RIG"}),
new sap.ui.ux3.NavigationItem("OFS_2",{Key:"RIG",text:"Well Program"})
]
})
],
worksetItemSelected:function(oEvent)
{
var sID = oEvent.getParameter("key");
switch(sID)
{
case"EXP":
var view = oshell.sap.ui.ux3.getCore.byId(sID);
view = sap.ui.view({
id: 'VIEW1', viewName:"expenserpt.exp_rpt", type:sap.ui.core.mvc.ViewType.JS});
this.addContent(view);
}
},
});
oshell.placeAt('container');
Hi Srinivas,
try this code
this code useful only when you want navigate between more than one view easily.
createContent : function(oController) {
var view1 = sap.ui.view({id:"idHome11", viewName:"mymusic.Home", type:sap.ui.core.mvc.ViewType.JS});
var view2 = sap.ui.view({id:"idHome22", viewName:"mymusic.DownloadPage", type:sap.ui.core.mvc.ViewType.JS});
var song = new sap.ui.ux3.NavigationItem("songid11", {
key:"btn",
text:"Home"
});
var download = new sap.ui.ux3.NavigationItem("downloadid", {
key:"music",
text:"Down Load"
});
var oShell = new sap.ui.ux3.Shell({
id:"mainshell",
appTitle :"MUSIC WORLD",
worksetItems:[song,download],
content :view1,
worksetItemSelected :function(oEvent){
var id = oEvent.getParameter("id");
var oShell = oEvent.getSource();
switch(id){
case 'songid11':
oShell.addContent(view1);
oShell.removeContent(view2);
break;
case 'downloadid':
oShell.addContent(view2);
oShell.removeContent(view1);
}
},
} );
return oShell;
}
view1 and view2 are new new views you have to create first
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Check out this video. This will be very helpful as a fresher.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Why you are creating the view 2 times,
check out this working example here-Shell Example - SAPUI5 Demo Kit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
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.