Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3323

Create different views without a controller

$
0
0

Hello

 

I would like to create a SAPUI5 Application with just some different views without a controller though.

I used this Blog to create the code so far:http://ameyablog.com/2014/04/29/develop-basic-navigation-sapui5/

 

./index.html

<script>    sap.ui.localResources("view");    var oShell = new sap.ui.ux3.Shell({                 id: "shell",             });    var loginView = sap.ui.view({                 id: "View1",                 viewName : "view.View1",                 type: sap.ui.core.mvc.ViewType.JS             });    oShell.addContent(sap.ui.getCore().byId("View1"));</script>

./view/View1.view.js

sap.ui.jsview("view.View1", {    getControllerName : function() {        return "view.View1";    },    createContent : function(oController) {        var button = new sap.ui.commons.Button({            "text": "Hello World!",            press : function() {                alert('Alert from Forward button');            }        });        return button;    }
});

In the Blod he explains that if the function "getControllerName" returns the same name, I am able to do everything in one File. But my browser is showing the following in console:

Error: failed to load 'view/View1.controller.js' from ./view/View1.controller.js: 404 - Not Found1 sap-ui-core.js:80:16196

 

Can anyone help me with this?

 

Greetings

Jan


Viewing all articles
Browse latest Browse all 3323

Trending Articles



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