on 2016 Sep 05 4:14 PM
Hi experts ,
I have done a splitapp in javascript (SAPUI5) . But when i try to do with xml means i am facing one problem here .
The problem is i when i navigate from master page to detail page i am getting error like (Control with ID idAppControl could not be found - EventProvider sap.ui.core.routing.Target ) like that only, i tried many times untill wt i know .
So if i did wrong anywere plz guide me and help me to find out a solution for this ,
Component.js
sap.ui.core.UIComponent.extend("dami.fistrout.Component",{
metadata:{
routing:{
config:{
viewType:"XML",
viewPath:"routing",
targetControl:"idAppControl",
clearTarget:false,
transition:"slide",
},
routes:[
{
pattern : "myList",
name : "myList",
view : "master1",
targetAggregation : "masterPages",
targetControl:"idAppControl",
subroutes : [
{
pattern : "detail",
name : "detailpage",
view : "detailpage",
targetAggregation : "detailPages",
},
{
pattern : "detail",
name : "detailpage2",
view : "detailpage2",
targetAggregation : "detailPages",
}
]
},
{
pattern : "",
name : "default",
view : "master",
targetAggregation : "masterPages",
targetControl:"idAppControl",
},
{
pattern : "detail",
name : "detailpage1",
view : "detailpage1",
targetAggregation : "detailPages",
}
]
}
},
init:function () {
jQuery.sap.require("sap.m.routing.RouteMatchedHandler");
jQuery.sap.require("sap.ui.core.routing.HashChanger");
//call CreateContent
sap.ui.core.UIComponent.prototype.init.apply(this,arguments);
this._router = this.getRouter();
//router initialize
this._routeHandler = new sap.m.routing.RouteMatchedHandler(this._router);
this._router.initialize();
},
createContent:function () {
var view = sap.ui.view({
id:"app",
viewName:"routing.routing",
type:"XML",
viewData:{component:this}
});
return view;
}
});
This is the code i have written to navigate a details page.
firstPage:function (){
var oRouter = sap.ui.core.UIComponent.getRouterFor(this);
oRouter.navTo("detailpage");
},
Warm regards,
Damian arjun
is the name of your XML view with the SplitApp control named 'routing.view.xml' and resides in a folder 'routing' under the resource root path?
metadata:{
routing:{
config:{
viewType:"XML",
viewPath:"dami.fistrout.routing",
targetControl:"idAppControl",
clearTarget:false,
transition:"slide",
},
assuming you defined a rootView based on XML the 'viewData' property isn't applicable
createContent:function () {
var view = sap.ui.view({
id:"app",
viewName:"dami.fistrout.routing.routing",
type:"XML",
viewData:{component:this}
});
please share your index.html too if the above is not true of your view structure.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
you have define 3 main routes in the code:-
Route | View Name (control area to put view) |
---|---|
default | master (masterPages) |
detailpage1 | detailpage1 (detailPages) |
myList | master1 (masterPages) + subroutes to navigate detailpage (detailPages) detailpage2 (detailPages) |
looking at your last screenshots, you were able to load the master view (initial run) which i assume is thru the route 'default' (while the detailPages portion on the right is still empty)
then you attempted to navigate with
firstPage:function (){
var oRouter = sap.ui.core.UIComponent.getRouterFor(this);
oRouter.navTo("detailpage");
},
from the list of routes, i think you probably wanted to navigate to 'detailpage1' instead.
your SplitApp control is in the 'routing.view.xml' (which is the rootView - i assume it is already set in your case by createContent method).
so using your simpler example above, the default route should simply be to the routing view where the 'idAppControl' ID can be found. the subroutes of the default route should incorporate the master and detail views.
User | Count |
---|---|
76 | |
10 | |
10 | |
10 | |
10 | |
9 | |
8 | |
7 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.