cancel
Showing results for 
Search instead for 
Did you mean: 

Control with ID idAppControl could not be found - EventProvider sap.ui.core.routing.Target

0 Kudos
1,788

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

  1. jQuery.sap.declare("dami.fistrout.Component");

     

      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




View Entire Topic
D_Chia
Active Participant
0 Kudos

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.

0 Kudos

Hi Chia ,

Thanks for your reply.

I attach here the index file and with the error msg screenshot  also so plz find it.

If you need more details about this plz ping me

Warm Regards ,

Damian arjun

D_Chia
Active Participant
0 Kudos

you have define 3 main routes in the code:-


RouteView Name (control area to put view)
defaultmaster (masterPages)
detailpage1detailpage1 (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.

0 Kudos

Hi Chia,

I have tired with that also but getting the same error.

Regards,

Damian

0 Kudos

Hi ,

See here not even I added here multiple pages .I added one master and one detail page eventhough I am getting the same error .

I attached here the image about which I am talking about .

Regards,

Damian .

D_Chia
Active Participant
0 Kudos

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.