I try to make a comma-separated list of authors in a headerObject
.
I have a binding and expand a list of authors (ManyToMany):
<ObjectHeader responsive="true" fullScreenOptimized="true" title="{database>Title}" intro="{i18n>details_by} {database>AuthorDetails}">
This code gives me the following result:
With {database>AuthorDetails/Name}
it shows me nothing. How can I expand the authors?
i think we can simplify have function in the controller
commaSeparator: function(oData) {
if (oData === null) {
return "";
}
var oModel = this.getView().getModel("database");
return oData.reduce(function(result, authorKey) {
var obj = oModel.getProperty("/" + authorKey);
return result === "" ? obj.Name : result + ", " + obj.Name;
}, "");
},