on 08-14-2015 2:29 PM
I have built an XML view as follow:
<List
id="people_list"
class="sapUiResponsiveMargin"
headerText="Custom Content"
items="{people>/People}">
<items>
<CustomListItem>
<Button text="{people>ProductName}"/>
</CustomListItem>
<CustomListItem>
<Label text="{people>ProductName}"/>
</CustomListItem>
</items>
</List>
"people" is JSON model in walkthrough sample.
I want to show a list of customizing item, which has two levels, a button above and a label below.
But what I get is only Labels, with Buttons disappearing as the attached picture shows.
I am wondering what's wrong with my code.
Hi Ming,
You have to place both the controls in content Aggregation of CustomListItem like this -
<CustomListItem>
<content>
<Label text="{people>ProductName}"/>
<Button text="{people>ProductName}"/>
</content>
</CustomListItem>
Check the API for reference - JsDoc Report - SAP UI development Toolkit for HTML5 - API Reference - sap.m.CustomListItem
Regards,
Sai Vellanki.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
2nd Label is overrinding because of <items>, so <CustomListItem> add both else remove <items>.
try,
<List
id="people_list"
class="sapUiResponsiveMargin"
headerText="Custom Content"
items="{people>/People}">
<items>
<CustomListItem>
<Button text="{people>ProductName}"/>
<Label text="{people>ProductName}"/>
</CustomListItem>
</items>
</List>
or
<List
id="people_list"
class="sapUiResponsiveMargin"
headerText="Custom Content"
items="{people>/People}">
<CustomListItem>
<Button text="{people>ProductName}"/>
</CustomListItem>
<CustomListItem>
<Label text="{people>ProductName}"/>
</CustomListItem>
</List>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.