11-23-2020 8:58 PM
hi all,
i have developed a simple on SAPUI5. Data is coming from ES5 Gateway system. This app has to show the salesorder<a href="/storage/temp/1865562-output.png">output.png</a>numbers and Customers and need to filter based on Given customer. Filter Operator is not working properly. For Example if SAP Is given as customer it is showing the first 5 records instead of showing the 5 records that has SAP as customer.using the liveChange event on searchfield
onSearch: function(oEvent){
var sSearchValue = oEvent.getSource().getValue(),
// var sSearchValue = oEvent.getParameter("Value"),
aFilters = [];
if(sSearchValue.length > 0){
var oFilterName = new Filter("CustomerName", sap.ui.model.FilterOperator.Contains, sSearchValue);
var oFilterID = new Filter("SalesOrderID", sap.ui.model.FilterOperator.Contains, sSearchValue);
aFilters.push(new Filter({filters:[oFilterID,oFilterName], And:false}));
}
this.getView().byId("table").getBinding("items").filter(aFilters,"Application");
11-24-2020 12:47 AM
check dev console in chrome if you have errors, if salesorderid is returned as integer you cannot use contains, only EQ
sap.ui.model.FilterOperator.EQ
11-24-2020 11:02 AM
11-24-2020 11:30 AM
Hi all,
when i am running the app with the same logic in controller and view what i have noticed when the app is thinking with 3 blue dots and if i put my customer query like"SAP" at that time it is showing the right results (all the customers with "SAP" are shown) but once the list is completely displayed then putting customer query in the search field it is not showing right result.
12-01-2020 12:24 PM
I still have the same problem. My controller logic is same.But result is coming differently. If i query before the data is loaded I am getting the right result. but if i query after the data is loaded then wrong result. I have noticed the GET request is behaving differently
(Tested in the browser too)
Right data for :
wrong data for:
query-before-data-is-loaded.pngquery-after-the-data-is-loaded-in-the-app.png
Please Suggest.
12-22-2020 3:57 PM
I have figured out the issue. in the Manifest file removed the following setting
for oData model. and it is all working fine.
"settings": { "defaultOperationMode": "Server",
"defaultBindingMode": "OneTime",
"defaultCountMode": "Request" },
Thank you,
Dipti.