Skip to Content
0

very new to UI. getting type mismatch error of _otargetHandler

Dec 09, 2016 at 10:50 AM

19

avatar image

Component.js:


jQuery.sap.declare("sap.demo.one.Component"); sap.ui.core.UIComponent.extend("sap.demo.one.Component", { metada: { routing: { config : { viewType : "JS", viewPath : "oneapp", targetControl : "splitApp", clearTarget : false, transition : "slide" }, routes : [ { pattern : "", name : "default", view : "Home", targetAggregation : "masterPages" } ] } }, init : function(){ jQuery.sap.require("sap.m.routing.RouteMatchedHandler"); jQuery.sap.require("sap.ui.core.routing.HashChanger"); //create content sap.ui.core.UIComponent.prototype.init.apply(this, arguments); this._router = this.getRouter(); //initialze router this._routeHandler = new sap.m.routing.RouteMatchedHandler(this._router); this._router.initialize(); }, createContent : function() { var oView = sap.ui.view({ id : "app", viewName : "oneapp.App", type : "JS", viewData : { component : this } }); var data = { item : [] } return oView; } })

index.html

<!DOCTYPE HTML> <html> <head> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv='Content-Type' content='text/html;charset=UTF-8'/> <script src="resources/sap-ui-core.js" id="sap-ui-bootstrap" data-sap-ui-libs="sap.m" data-sap-ui-resourceroots='{ "oneapp" : "./oneapp", "sap.demo.one" : "./" }' data-sap-ui-theme="sap_bluecrystal"> </script> <!-- only load the mobile lib "sap.m" and the "sap_bluecrystal" theme --> <script> jQuery.sap.require("sap.demo.one.common"); new sap.m.Shell("Shell", { app : new sap.ui.core.ComponentContainer({ name : "sap.demo.one" }) }).placeAt('content'); </script> </head> <body role="application"> <div id="content"></div> </body> </html>

App.view.js

sap.ui.jsview("oneapp.App", { /** Specifies the Controller belonging to this View. * In the case that it is not implemented, or that "null" is returned, this View does not have a Controller. * @memberOf oneapp.App */ getControllerName : function() { return "oneapp.App"; }, /** Is initially called once after the Controller has been instantiated. It is the place where the UI is constructed. * Since the Controller is given to this method, its event handlers can be attached right away. * @memberOf oneapp.App */ createContent : function(oController) { this.setDisplayBlock(true); return new sap.m.SplitApp("splitApp", {}); } });

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers