Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 3570

Re: While adding pages, not able to get controller.js recognize view.xml

$
0
0

Your controller code should initializing the controller not the view.

 

The controller is initalised from inside the view

 

Ideally you would have your controller code in a separate folder in you project tree.

 

You code would the look like this

<core:View

   controllerName="sap.ui.PageRoutingDemo.wt.controller.MainView"

   xmlns:core="sap.ui.core"

   xmlns="sap.m"

   xmlns:mvc="sap.ui.core.mvc" >

<App xmlns="sap.m"   id="rootControl"/>

</core:View>

 

sap.ui.define([

   "sap/ui/core/mvc/Controller",

  "sap/m/Page"

], function (Controller) {

   "use strict";

   return Controller.extend("sap.ui.PageRoutingDemo.wt.controller.MainView", {

onInit : function () {

}

   });

});

 

regards

Chantele


Viewing all articles
Browse latest Browse all 3570

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>