Skip to Content

Bind Association XSOData in UI5?

Let's say I have Employee entity associated with Address entity in XSOData and I want to bind them to a single control - StandardListItem. How to achieve this?

<List id="EmployeeList" headerText="Employees" items="{ path: '/Employee'}">
  <items>
    <StandardListItem title="{Name}" //from Employee entity
                      description="{Address}" //from Address entity
    />
  </items>
</List>

Associated address details available at Employee('emp1')/Address/


TIA.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Nov 05, 2017 at 09:44 AM

    You have to add a binding specific parameter that the associated Address is expandend. Then you can access the properties of the Address via "Address/<property name>" (e.g. Address/City - if "City" is a valid property of course).

    <List id="EmployeeList" headerText="Employees" items="{ path: '/Employee', parameters: { expand: 'Address'} }">
      <items>
        <StandardListItem title="{Name}" //from Employee entity
                          description="{Address/City}" //from Address entity
        />
      </items>
    </List>

    If you wanna combine different Address properties for your description field you can use expression binding or the parts syntax.

    Regards,
    Florian

    Add comment
    10|10000 characters needed characters exceeded