on 02-06-2020 11:24 PM
Hi team. I'm wondering how to bind Complex type - Collection(Edm.String- into List. Example:
Service (odata v4) https://services.odata.org/V4/TripPinServiceRW
.
Entity Type :Person has property :
<Property Name="Emails" Type="Collection(Edm.String)"/>
I setup something like
<List id="list0" items="{Emails}">
<items>
<StandardListItem title="{}" id="item1"/>
</items>
</List>
Number of items is ok but the content of the title is not displayed . What should I put there ?
Hi Szymon,
for me it's work.
This is my code.
Controller:
sap.ui.define([
'jquery.sap.global',
'sap/ui/core/mvc/Controller',
'sap/ui/model/json/JSONModel'
], function (jQuery, Controller, JSONModel) {
"use strict";
var ListController = Controller.extend("sap.m.sample.ListCounter.List", {
onInit: function (evt) {
// set explored app's demo model on this sample
var email = {
email: ["sebastiano@mail.com", "marchesini@mail.com"]
};
var oModel = new JSONModel(email);
this.getView().setModel(oModel);
}
});
return ListController;
});
view :
<mvc:View controllerName="sap.m.sample.ListCounter.List" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m">
<List headerText="Products" items="{ path: '/email' }">
<StandardListItem id="item1" title="{}"/>
</List>
</mvc:View>
The result:
Regards,
Sebastiano
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
You may have to specify the path explicitly.
<List headerText="Persons" items="{ path: '/Emails'}" >
<StandardListItem title="{Email}" />
</List>
Regards,
Venkat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank For you feedback but in my example I used odata V4 as the model with its metadata. I agree with You that for JSON model it is working .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.