cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with List output - same records are repeating

govind_parmar
Participant
0 Kudos
hi UI5 Experts,
 
I am having issues with repetitive data in my UI on the list , although the backend data seems to be okay.
 
Below is my code: 
Manifest:
    "dataSources": {
      "polService": {
        "uri": "sap/opu/odata/SAP/*********/",
        "type": "OData",
        "settings": {
          "annotations": [],
          "localUri": "localService/metadata.xml",
          "odataVersion": "2.0"
        }
      }  
 
XML View:
The view has an input which is being used as a filter condition in the backend api.
Input value is '12344' taken in this example:
 
<Input id="input2" 
value="{/InputValue1}" 
valueLiveUpdate="true" 
width="200px" enabled="{/enabled}" 
liveChange=".onLiveChange" />
 
<Panel backgroundDesign="Solid">
<List id="polServicetab"
headerText="{i18n>BillingAccountPoliciesTitle}"
class="sapUiResponsiveMargin"
width="auto"
items="{polService>/PolicyDetailSet}" >
<items>
<ObjectListItem id="ObjectListItem1"  title="{polService>PolicyNo} X {polService>BillType}"
number="{
parts: [
'polService>PremiumAmt',
'view>/currency'
],
type: 'sap.ui.model.type.Currency',
formatOptions: { showMeasure: false}
}"
numberUnit="{view>/currency}"
/>
</items>
</List>
</Panel>
 
 
Controller:
 
onLiveChange: function (oEvent) {
var aFilters = [];
var sfilterVal = oEvent.getParameter("value");
if (sfilterVal) {
aFilters.push(new sap.ui.model.Filter("BillingAccountNumber", sap.ui.model.FilterOperator.EQ, sfilterVal));
}
const oList = this.byId("polServicetab");
const oBinding = oList.getBinding("items");               
oBinding.filter(aFilters);  
}
 
From back end service polService>/PolicyDetailSet('12344') returns me 8 unique entries but for some reason the last entry is being repeated 8 times as shown below:
 
govind_parmar_1-1709694270066.png
govind_parmar_0-1709694234336.png
Please can you let me know 8 entries are being repeated, I could see the PolicyDetailSet('12344')  is being repeated in the keys , not sure why.
 
Also is there a better design based on the above requirements.
 
#UI5
 
Thanks.
 
 

 

 

Accepted Solutions (0)

Answers (0)