Skip to Content
0
Jun 15, 2018 at 10:56 PM

Accessing a Nested Named Model in XML View

93 Views Last edit Jun 15, 2018 at 10:59 PM 4 rev

Hey Everyone,

I have a particular scenario. I have a named JSON model and it is nested. I'd like to access the nested items within a list of a list. I'm having a problem with the syntax of the XML. Or perhaps there is a better way?

My named model is myMarketingModel and it looks like this.

odata-for-marketing-model.png

I need to create a list of lists that have fundamentally ->

AttributeSet

attribute - value

attribute - value

AttributeSet

attribute - value

etc.

My XML I'm pretty sure is the problem. Here is my XML with a list of lists.

<List items="{myMarketingModel>/}">
 <items>
  <CustomListItem xmlns="sap.m">
   <content>
    <Label text="{myMarketingModel>attributeSet}"></Label>
     <List xmlns="sap.m" items="{myMarketingModel>/}" >
      <items>
       <StandardListItem title="{myMarketingModel>subset/attribute}"/>
      </items>
     </List>
    </content>
   </CustomListItem>
  </items>
</List>

I can't seem to nail down the syntax of the StandardListItem. The first list is fine. I've tried a wide variety of permutations on the inner list. I thought I'd ask here if anyone had some insight.

I appreciate any help.

Oh...I'm open to modifying the named model if someone has an idea on how to do this better. It is just used to view data so I can do anything I want to it.

Thanks,
Greg

Attachments