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

404 error loading your own view classes from another of your own view classes?

$
0
0

Hi,

 

Not sure what it wrong here.

 

[code]

GET http://54.72.75.157:8000/Test/PRJ-UI5/WebContent/view/MapZone-dbg.js 404 (Not Found)

sap-ui-core-dbg.js:8103 GET http://54.72.75.157:8000/Test/PRJ-UI5/WebContent/view/MapZone.js 404 (Not Found)

sap-ui-core-dbg.js:14438 Uncaught Error: failed to load 'view/LiveDashboard.view.js' from ./view/LiveDashboard-dbg.view.js: Error: failed to load 'view/MapZone.js' from ./view/MapZone.js: 404 - Not Found

[/code]

 

I have added  the localResources code

 

[code]

<script>
sap.ui.localResources("view");
sap.ui.localResources("suite");
var app = new sap.m.App({initialPage:"testsui5"});
var page = sap.ui.view({id:"testui5", viewName:"view.LiveDashboard", type:sap.ui.core.mvc.ViewType.JS});
app.addPage(page);
app.placeAt("content");
</script>

[/code]

 

My LiveDashboard has the sap.jquery include and I added all views to the Controller so I can get at them

 

[code]

jQuery.sap.require("view.MapZone");

jQuery.sap.require("view.Client");

 

sap.ui.jsview("view.LiveDashboard", {

 

    /** 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 test.ui5admin.Admin

    */

    getControllerName : function() {

        return "view.Admin";

    },

 

    /** 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 test.ui5admin.Admin

    */

    createContent : function(oController) {

        if(typeof oController.views == 'undefined' )

            oController.initViews();

        // First menu - Live dashboard - layout and views     

        var mapZoneLiveSelector = oController.views.mapZone;

        var clientDetail = oController.views.client;

 

        var oLiveDashboardLayout = new sap.ui.layout.HorizontalLayout("liveDashboardHeader", {

            content :  [mapZoneLiveSelector,clientDetail]

        });

     

        return oLiveDashboardLayout;

    }

[/code]

 

Here is the initViews part of the Controller

 

[code]

initViews: function(){
console.log("About to init views");
this.views = [
{"client": new view.Client()},
            ...
{"mapZone": new view.MapZone()}
];

    },

[/code]


Viewing all articles
Browse latest Browse all 8419

Trending Articles



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