Skip to Content
author's profile photo Former Member
Former Member

Control app does not have an aggregation called pages - EventProvider sap.ui.core.routing.Target

Hello Experts,

I am working with SAPUI5 (the current version) and Eclipse Luna to build SAP Fiori-Apps.

Now here my case:

I am working on a project with routing. But during the load process (without doing anything), I got the error message:

"Control app does not have an aggregation called pages - EventProvider sap.ui.core.routing.Target".

Here my manifest.json file:

---------------------------------------

{

"_version": "1.1.0",

"sap.app": {

"_version": "1.1.0",

"id": "com.edu.sapui5",

"type": "application",

"i18n": "i18n/i18n.properties",

"applicationVersion": {

"version": "0.0.1"

},

"title": "{{APP_TITLE}}",

"description": "{{APP_DESCRIPTION}}",

"sourceTemplate": {

"id": "ui5template.basicSAPUI5ApplicationProject",

"version": "1.32.0"

}

},

"sap.ui": {

"_version": "1.1.0",

"technology": "UI5",

"deviceTypes": {

"desktop": true,

"tablet": true,

"phone": true

},

"supportedThemes": [

"sap_bluecrystal"

]

},

"sap.ui5": {

"_version": "1.1.0",

"rootView": {

"viewName": "com.edu.sapui5.view.App",

"type": "JS"

},

"dependencies": {

"minUI5Version": "1.30.0",

"libs": {

"sap.m": {}

}

},

"models": {

"i18n": {

"type": "sap.ui.model.resource.ResourceModel",

"settings": {

"bundleName": "com.edu.sapui5.i18n.i18n"

}

}

},

"resources": {

"css": [{

"uri": "css/style.css"

}]

},

"routing" : {

"config" : {

"targetClass" : "sap.m.routing.Router",

"viewPath" : "com.edu.sapui5.view",

"controlId" : "app",

"controlAggregation" : "pages",

"viewType" : "JS"

},

"routes" : [{

"pattern" : "",

"name " : "app",

"target" : "app",

"targetAggregation" : "pages",

"targetControl": "idAppControl"

},{

"pattern" : "search",

"name" : "search",

"target" : "search",

"targetAggregation" : "pages",

"targetControl": "idAppControl",

"clearTarget" : true

},{

"pattern" : "project",

"name" : "project",

"target" : "project",

"targetAggregation" : "pages",

"targetControl": "idAppControl",

"clearTarget" : true

}],

"targets" : {

"app" : {

"viewName" : "App"

},

"search" : {

"viewName" : "Search"

},

"project" : {

"viewName" : "Project"

}

}

}

}

}

The Component.js file:

--------------------------------

sap.ui.define([ "sap/ui/core/UIComponent", "sap/ui/model/json/JSONModel",

"com/edu/sapui5/model/models","com/edu/sapui5/util/config" ], function(UIComponent, JSONModel, models, config) {

return UIComponent.extend("com.edu.sapui5.Component", {

metadata : {

manifest : "json"

},

init : function() {

UIComponent.prototype.init.apply(this, arguments);

this.getRouter().initialize();

}

});

});

And here the initial page will be shown on start:

--------------------------------------------------------------------

sap.ui.define([ "sap/ui/core/mvc/Controller", "sap/ui/core/routing/History", "sap/m/MessageToast", "sap/m/Dialog", "sap/m/Button" ],

function(Controller, History, MessageToast, Dialog, Button) {

return Controller.extend("com.edu.sapui5.controller.Search", {

getComponent : function() {

var cId = sap.ui.core.Component.getOwnerIdFor(this.getView());

return sap.ui.component(cId);

},

onPressSearch : function(oEvent) {

var component = this.getComponent();

component.getTargets().display("project");

}

});

}

);

Also when I remove the lines:

"targetAggregation" : "pages" and "targetControl": "idAppControl" from routing above, the same error is coming up.

May would that be helpful when I switch to another SAPUI5 version, because in my app before I did not see an error like this?

Thanks a lot for urgent help.

Regards,

Cengiz

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jul 19, 2016 at 01:49 PM

    I have restructured the whole application. The error is fixed. My solution was:

    1) Create Search.view.js (search page)

    2) Create Project.view.js (project list page)

    3) Create Layout.view.js (Layout with header and body)

    On top (header), I have two tabs to switch between the pages. And the Layout.view.js itself is integrated as PAGE into App.view.js. In my manifest.json configuration of routing, I have defined all the view pages, expect of App.view.js.

    Many thanks to all,

    Cengiz

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 15, 2016 at 10:43 AM

    Does your App.view.JS have an App control declared with the id idAppControl?

    Add a comment
    10|10000 characters needed characters exceeded

    • i have not seen "targetControl" and "targetAggregation" properties used in relation to routing config.


      i am certain though there is "controlId" and "controlAggregation" properties.


      in manifest.json, it can be set at the routing/config level as 'global' setting applicable to all routes (can be override at individual route level)


      "routing": {
      "config": {
      ...
      "controlId": <the id name given to App container control>,
      "controlAggregation": <depends on the container control eg. sap.m.App will be "pages">,
      ...
      },

      ...

      }


      following the latest code you have above ( where var oApp = new sap.m.App("idAppControl") ) , it should be as follows:-


      "controlId": "idAppControl"

      "controlAggregation": "pages"

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.