on 2020 Nov 13 10:31 AM
Hello all. I have a problem with a binding expression in a column of a table (sap.ui.table).
Currently my column points to a property of the first position of an array (results/0/cust_Date😞
<Column>
<m:Label text="Date"/>
<template>
<m:Text text="{path:'externalCodeOfcust_PRLRMNav/results/0/cust_Date', formatter:'.formatter.convertDate'}" wrapping="false"/>
</template>
</Column>
but now I want to point to a property of the last position of the array (results/...results.length-1/cust_Date).
For this I have tried many combinations of this type:
<Column>
<m:Label text="Date"/>
<template>
<m:Text text="{path:'externalCodeOfcust_PRLRMNav/results/{= ${externalCodeOfcust_PRLRMNav/results}.length-1}/cust_Date', formatter:'.formatter.convertDate'}" wrapping="false"/>
</template>
</Column>
With this binding expression:
{= ${externalCodeOfcust_PRLRMNav/results}.length-1}
I can get the length of the array and then with -1 to know the last position, but when I combine it with the rest of the path to get the cust_Date property, it doesn´t work. Do you know how I could do it?
Thanks in advance. Best Regards
Request clarification before answering.
Thank you very much Sergei.
That has worked for me with that binding:
<m:Text text="{= ${externalCodeOfcust_PRLRMNav/results}[ ${externalCodeOfcust_PRLRMNav/results}.length-1 ].cust_Date'}" wrapping="false"/>
, but it doesn't work for me with a binding with path (for formatting):
<m:Text text="{path:'= ${externalCodeOfcust_PRLRMNav/results}[ ${externalCodeOfcust_PRLRMNav/results}.length-1 ].cust_Date', formatter:'.formatter.convertDate'}" wrapping="false"/>
Would you know why?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
62 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 | |
4 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.