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

Re: UIComponent.js:6 Uncaught Error: No view type specified.

$
0
0

Code inside my View is as follows:-

 

 

My First View Page:-  View1.view.xml

<mvc:View xmlns:html="http://www.w3.org/1999/xhtml" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m" controllerName="StartApplication.controller.View1">

  <Page title="Welcome to First Page" id="idpage1">

  <content>

  <Button text="Click me!!" press="Click" busy="false" type="Accept"/>

  </content>

  </Page>

</mvc:View>


Code of my Second View:-  Pge2.view.xml

<mvc:View xmlns:core="sap.ui.core" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m" controllerName="StartApplication.controller.Pge2"

  xmlns:html="http://www.w3.org/1999/xhtml">

 

 

  <Page title="Welcome to Page2">

  <content>

     <Text text=" Navigation successful.."></Text>

  </content>

  </Page>

 

</mvc:View>

 

 

Code of my Controllers:-

 

My first controller :- View1.controller.js

 

sap.ui.define(["sap/ui/core/mvc/Controller"], function (Controller) {

  "use strict";

  return Controller.extend("StartApplication.controller.View1", {

  /**

  *@memberOf QuickStartApplication.controller.View1

  */

Click: function () {

//This code was generated by the layout editor.

//this.navTo("");

this.getRouter().navTo("page2");

  }

  });

});

 

Note:-  I have added any code inside Pge2.controller.js

 

 

Code inside Component.js:-

 

 

sap.ui.define([

  "sap/ui/core/UIComponent",

  "sap/ui/Device",

  "StartApplication/model/models"

], function(UIComponent, Device, models) {

  "use strict";

 

 

  return UIComponent.extend("StartApplication.Component", {

 

 

  metadata: {

  manifest: "json"

  },

 

 

  /**

  * The component is initialized by UI5 automatically during the startup of the app and calls the init method once.

  * @public

  * @override

  */

  init: function() {

  // call the base component's init function

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

            this.getRouter().initialize();

  // set the device model

  this.setModel(models.createDeviceModel(), "device");

  }

  });

 

 

});


Viewing all articles
Browse latest Browse all 2801

Trending Articles



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