cancel
Showing results for 
Search instead for 
Did you mean: 

SAPUI5 Binding Association of main object to list on second page

0 Kudos

Hi everybody,

I'm struggling with the binding of an association to a list overview on the next page.

I.e. A supplier has multiple contracts. Selecting the supplier on the first screen navigates to the second screen using odata models inclusing associations. I'd like to bind the associations result tot the object list on the next page, but somehow it doesn't work on the layout editor. Any ideas how to bind it to the object list?

Current code in layout editor generates to this (pages = contractitemset)

<App id="contractselection" pages="{CONTRACTITEMSet}">
<pages>
    <ObjectListItem xmlns:core="sap.ui.core" xmlns:mvc="sap.ui.core.mvc" 
    xmlns:html="http://www.w3.org/1999/xhtml" xmlns:sap.ui.layout="sap.ui.layout" 
    xmlns="sap.m" type="Active" title="Object list item" number="9999999999" 
    numberUnit="eur" intro="On behalf of John Doe" id="__item0_copy">

but I was expecting something like this (where suppliertocontractitem is the association from the backend) (pages is suppliertocontractitem)

<App id="contractselection" pages="{supplierToContractitem}">
<pages>
    <ObjectListItem xmlns:core="sap.ui.core" xmlns:mvc="sap.ui.core.mvc" 
    xmlns:html="http://www.w3.org/1999/xhtml" xmlns:sap.ui.layout="sap.ui.layout" 
    xmlns="sap.m" type="Active" title="Object list item" number="9999999999" 
    numberUnit="eur" intro="On behalf of John Doe" id="__item0_copy">
        <attributes>
            <ObjectAttribute text="attribute text" id="__attribute0_copy"/>

I'm just lost here and I have the idea it is quite simple 😞

Kind regards and thanks

Laurens

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

Found the issue. The code should be the following: I used another list but with the specific binding.

  <List noDataText="Drop list items here" id="itemlist" items="{CONTRACTITEMSet}">

And funny thing is: I had the assumption the getEntity implementation was ok but one unpack was missing. Therefor the result was always empty, and as we all know, objectlist just don't show anything when it is empty.

So lesson learned: assumption is the mother of all....code features 🙂

Thx!