Search code examples
bindingodatasapui5

UI5 oData binding: Bind property of parent note when using associations


I have an entity set for employees (EmployeeSet) with an association to further details.

EmployeeSet(1) holds the data for one employee and is bound to a detail view. Inside this view I'm using a form to bind the further details with an association called ToFurtherDetails.

No I need one property from EmployeeSet(1) inside this form.

Is there a way to bind a property from a parent node?


Solution

  • You are able to use the expand Parameter to request the ToFurtherDetails from the OData Service.

    For example you bind your EmployeeSet in the Master-View like this:

    <List id="list" items="{ path: '/EmployeeSet', parameters: {expand : 'ToFurtherDetails'} }" itemPress="handleSelect" />

    Now you are able to access the ToFurtherDetails in your Detail-View like this /EmployeeSet(1)/ToFurtherDetails