Skip to Content
-1
Nov 23, 2020 at 08:58 PM

SAPUI5 Filters

63 Views

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");

Attachments

output.png (39.6 kB)
codeinview.txt (1.5 kB)