Skip to Content

very new to UI. getting type mismatch error of _otargetHandler

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", {}); } });

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

0 Answers

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.