Search code examples
data-bindingodatasapui5

How to use absolute paths in SAPUI5's ODataModel?


I want to use absolute paths in my SAPUI5 application in order to access a single resource directly.

According to http://help.sap.com/saphelp_nw75/helpdata/de/6c/47b2b39db9404582994070ec3d57a2/content.htm it should work.

But when I use something like:

<Text text="{users>/Users('123')/LastName}" />

It cannot fetch the data.

Has anyone a clue what is wrong here?


Solution

  • When using a parameterized path to a property, it seems that the value doesn't get loaded automatically.

    To get access to the object defined by the parameter, you could specify an element binding for that object on your control and then reference the property in a relative way:

    <Text binding="{users>/Users('123')}" text="{users>LastName}" />