Skip to Content
0
Former Member
Dec 08, 2013 at 03:35 PM

Redirect access to application resources in SAPUI5

141 Views

Hi Experts,

I was trying to load a application resources from a different package than the page resides. The sap.ui.localResources() has the limitation that it can only load the application from the same folder root. Is there a way to do that from a different folder root? I thought the jQuery.sap.registerModulePath() might be useful here, however, I was not able to find an example how to use it. Any hints?

<!DOCTYPE HTML>

<html>

<head>

<meta http-equiv="X-UA-Compatible" content="IE=edge">

<script src="/sap/ui5/1/resources/sap-ui-core.js"

id="sap-ui-bootstrap"

data-sap-ui-libs="sap.ui.commons"

data-sap-ui-theme="sap_goldreflection">

</script>

<!-- add sap.ui.table,sap.ui.ux3 and/or other libraries to 'data-sap-ui-libs' if required -->

<script>

sap.ui.localResources("application_resources");

var view = sap.ui.view({id:"application_resources1", viewName:"application_resources.View", type:sap.ui.core.mvc.ViewType.JS});

view.placeAt("content");

</script>

</head>

<body class="sapUiBody" role="application">

<div id="content"></div>

</body>

</html>

Regards

Casper