cancel
Showing results for 
Search instead for 
Did you mean: 

Changing resource path.

Former Member
0 Kudos

Hello everyone,

I m building a small project using Open UI5 and I m having some issues with file structure.

The structure is like this.

<project>/library/open_ui5/sap-ui-core.js

The below works

<project>/library/open_ui5/<app_js>/xyz.view.js

But I want to have something like this.

<project>/js/<app_js>/xyz.view.js

Following is the code so far.

index.html

<script id='sap-ui-bootstrap'

        src='{$app_url}library/open_sap_ui5/sap-ui-core.js' 

        data-sap-ui-theme='sap_goldreflection' 

        data-sap-ui-libs='sap.ui.commons,sap.ui.table'></script>

index.js

var view = sap.ui.view({id:"id_tracker.main", viewName:"tracker.main", type:sap.ui.core.mvc.ViewType.JS});

view.placeAt("content");

Thanks in advance.

Accepted Solutions (0)

Answers (1)

Answers (1)

AndreasKunz
Advisor
Advisor
0 Kudos

Hi,

registerModulePath() will be your friend. See the "Module Concept" docu or Modularization and Dependency Management - User Interface Add-On for SAP NetWeaver - SAP Library

Regards

Andreas

Former Member
0 Kudos

Hi there,

you might also have to declare the "js" path as local resource


sap.ui.localResources("js");

jQuery.sap.registerModulePath("<app_js>", "js/<app_js>");

The latter assumes that the objects you have declared in the files under "js/<app_js>" have a namespace beginning with "<app_js>". Otherwise you have to change the first argument to registerModulePath.

HTH,

M.

sap.ui.localResources("js");jQuery.sap.registerModulePath('<app_js>', 'js/<app_js>');