Skip to Content

How to bind in sapui5 a navigation property

Dec 12, 2017 at 08:28 AM


avatar image
Former Member

Hi all,

I have a tree-like odata model where each node has a unique own identifier, possibly a unique identifier of its parent(if it has one) and of course some other description properties. I have created a navigation property "PARENT" which gives back the parent of a node. I have checked that the navigation works correctly by checking the service url. so when i append "/PARENT" to the service url i do get back correctly the parent.

What i want to do is the following. I have an xml view which i bind to a fixed node, the binding works for the normal properties of the node, like its id or description, but i can figure out how to use binding in the xml view to get the parent. So I want to do sth like:


... contents of the page


Now the DESCRIPTION is bound properly but he PARENT/DESCRIPTION is missing. I could get it by coding in the controller or maybe by creating a formatter, but I would prefer to have a simple solution like above. Does anyone know how I could achieve this binding of a navigation property?

Thanks in advance

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
avatar image
Former Member Dec 12, 2017 at 11:06 AM

Someone already gave me the answer. I should enhance the bindElement in the init function to have: parameters {expand: "PARENT"}

10 |10000 characters needed characters left characters exceeded