Showing results for 
Search instead for 
Did you mean: 

SAPUI5 search on DataSet

Former Member
0 Kudos

Hi there, I would like to know, if someone has managed to implement a search in the DataSet control, that works like the suggest event in the normal searchField? The DataSet has only a search event, that get fired after hitting "enter".

Any suggestions? Thx

View Entire Topic
Active Contributor
0 Kudos


Put following code in the search event

var sQuery = oEvent.getParameter("query");

var oBinding = oDataSet.getBinding("items");

oBinding.filter(!sQuery ? [] : [new sap.ui.model.Filter("title", sap.ui.model.FilterOperator.Contains, sQuery)]);


Here you have an example:

Kind regards,


Former Member
0 Kudos

Hi Wouter, thank you for the reply, Your code is for searching the data set and it's already in and working. But my problem was the "search" event itself. It get fired after pressing the ENTER key and I was looking for a solution to make it work after entering a charachter. I'm missing a  "suggest" event.

Kind regards, Chis

Active Participant
0 Kudos

One way to do that is to create a new search object


and implement the attachSuggest method

something like this

var search = new sap.ui.commons.SearchField(

         "mySearch", {

          enableListSuggest : false,

          enableClear : true,

          startSuggestion : 0,

          value :  "Search"


search.attachSuggest(function(oEvent) {



       }, oController)

in controller

_searchMe = function (query) {

     //get DS object and apply the filter you mentioned above

     //filtering will be triggered be on a keystroke