0
votes

I am using sap.m.list with smartforms in Splitapp. The problem is, I cannot use json Model for list since the binding context wont work for smartfrom.

But when I bind the list to Odata Model directly, the cache model data from the first $skip0 & top=100 dont let me filter data. No matter if I call the read function of odata Model again, it will fetch the data but the old cache data remains there and in the list.

I tried clearing the cache model data with refresh(true,true) but it triggers the same $count and $skip0 & top=100 again.

1
Edit the question and show a minimal reproducible example. See How to Ask. - user1531971

1 Answers

0
votes

You need to set the filters on binding level

https://sapui5.hana.ondemand.com/sdk/#/api/sap.ui.model.odata.v2.ODataListBinding/methods/filter

In a controller it works this way (assuming your Entity has property Prop:

oList.getBinding('items').filter( new Filter('Prop', FilterOperator.EQ, 'someValue' );

Or, in an XML view:

<List items="{path: 'EntitySet',  filters: [{ path : 'Prop', operator : 'EQ', value1 : 'someValue'},...] }”>

also have a look at Filter and FilterOperator