Skip to Content
0
May 29, 2020 at 10:52 AM

Showing busy indicator on sap.m.Input while waiting for suggestions

608 Views

I have a sap.m.Input on which I have I have a suggest handler as follows, which fetches data from the backend.

handleMaterialSuggest: function (oEvent) {
	var sTerm = oEvent.getParameter("suggestValue");
	var aFilters = [];
	if (sTerm) {
		aFilters.push(new Filter('Matchcode', sap.ui.model.FilterOperator.Contains, sTerm.toUpperCase()))
		aFilters.push(new Filter('MaterialNumber', sap.ui.model.FilterOperator.Contains, sTerm.toUpperCase()))
	}
	var orFilter = new Filter({ filters: aFilters, and: false })
	var oBinding = oEvent.getSource().getBinding("suggestionItems")
	oBinding.filter([orFilter])
	oEvent.getSource().setFilterSuggests(false)
}

I want to set a busy indicator on the control when suggestions are being fetched, and I can do this easily enough with oEvent.getSource().setBusy(), but I don't see any event that I can use to remove the busy indicator when the request returns.

How would I remove a busy indicator once the suggestions have loaded?