cancel
Showing results for 
Search instead for 
Did you mean: 

Change viewName path on sap.ui.view()

Former Member
0 Kudos

Hello, I have the following question:

I am trying to create a view object, access a existent SAPUI5 view file and place it on the html.

When I try to make the object and fill the viewName field:

viewName: "list/someView"

Instead of accessing th someView.view.html, that is on the same folder (called 'list') that the main html file, it tries to find a someView file inside my resources folder. I've tried adding ../ to the start of the path but it still searches for "resources//list/someView" instead of finding "list/someView".

How can I tell the view constructor to stop searching inside the resources?

Thanks for all the help.

Accepted Solutions (0)

Answers (1)

Answers (1)

kedarT
Active Contributor
0 Kudos

Hi,

Use sap.ui.localResources("list") in your index.html

Hope this helps

Former Member
0 Kudos

Sorry, I didn't really understand it.

I tried calling that before my sap.ui.view declaration but it didn't work.

Do I call it on my script, put it in my header or do something else entirely ?

Thanks anyway

kedarT
Active Contributor
0 Kudos

Do that in your script part before the the view declaration.

If it does not resolve, please past your application folder hierarchy here.

Former Member
0 Kudos

list/index.html

list/selfCheckout.view.html (the view I want on viewName)

/list/resources/... (the path is looking here, what I want to change)

Former Member
0 Kudos

Did you mention any value in the Resource roots? like below

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

          id="sap-ui-bootstrap"

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

          data-sap-ui-xx-bindingSyntax = "complex"

          data-sap-ui-resourceroots = '{

                                "shoppingcart": "./shoppingcart",

                                "sap.demo.cart": "./"

                               }'

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