Hi All,
I tried to follow SAPUI5 demo on dynamic suggestion item whereby on event "suggest" I add new filter for the suggestion item binding.
The link to the demo is here: Sample: Input - Suggestions - Dynamic
The only difference with the sample is I am using oData model instead of Json and I use Contains as the Filter Operator.
handleSuggest: function(oEvent) {
var sTerm = oEvent.getParameter("suggestValue");
var aFilters = [];
if (sTerm) {
aFilters.push(new Filter("CompanyName", sap.ui.model.FilterOperator.Contains, sTerm));
}
oEvent.getSource().getBinding("suggestionItems").filter(aFilters);
}
When I debug the oData service in the backend, I notice getEntitySet return correctly based on the filter.
However, it seems like the input field behaviour still only show the result based on Start With filter because it will only suggest records that start with the search term that I typed.
Is the example given by SAP only applicable for StartsWith filter?
If yes, I found it quite redundant because the suggestion items itself already use Start With condition as default.
Is there a way to force my new filter result to be used as suggestion items shown for this specific input?
Thank you.
Regards,
Abraham