Reputation: 707
I am developing Fiori App to display some sales data, called from an OData Service. I have a header (invoiceHeaderSet) with the field "Waerk" to display the currency key.
I have positions (/invoiceHeaderPositionsNav) bound to a table. Now, I want to display the headers "Waerk" field next to each positions currency field "Netwr".
How can I do this in XML views without creating surplus local models? Below, you will see a simplified example of my problem.
// this view is bound to OData /invoiceHeaderSet
<ObjectHeader
numberUnit="{Waerk}"/> <-- does work
<Table
items="{
path: 'invoiceHeaderPositionsNav'
}" />
<ColumnListItem
<Text text="{'Netwr'} <-- does work
{'/invoiceHeaderSet/Waerk'}"/> <-- does not work
Upvotes: 2
Views: 3638
Reputation: 6190
Solution A
Did you activate the complex binding syntax in the bootstrapping part of your index.html?
data-sap-ui-bindingSyntax="complex"
Solution B
What you could also do is writing your own formatter method. For that you have to change your binding to something like this:
text="{ parts: [{ path: 'Netwr' }, { path: '/invoiceHeaderSet/Waerk' }], formatter: '.formatTitle' }"
And in your Controller you have to implement the formatTitle
function, e. g.
formatTitle: function (sNetwr, sWaerk) {
return sNetwr + " " + sWaerk;
},
Upvotes: 1