Skip to Content
0

SAPUI5 Binding Association of main object to list on second page

Feb 08 at 02:26 PM

22

avatar image
Former Member

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

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

1 Answer

avatar image
Former Member Feb 08 at 04:13 PM
0

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!

Share
10 |10000 characters needed characters left characters exceeded