Skip to Content

Filter works with Mock Data but not with OData

Feb 02 at 01:26 AM


avatar image


I am searching a table based on the input from the user. I'm having trouble with filtering the oData but this works when using mock data. The mock data ends up displaying only the rows that contain the search input but the oData ends up removing all the rows completly. The metadata is the same on both.


searchID: function(oEvt) {
	// add filter for search
	var aFilters = [];
	var sQuery = oEvt.getSource().getValue().toString().toUpperCase();
if (sQuery && sQuery.length > 0) { var filter = new Filter("ID", sap.ui.model.FilterOperator.Contains, sQuery); aFilters.push(filter);}
// update list binding var list = this.getView().byId("Table"); var binding = list.getBinding("items"); binding.filter(aFilters, "Application"); },
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers