Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

"Suggest" Event for Live Search in SearchField

Hi,

I am using search field with live search and suggestions option enabled for SAP Web IDE Application.

When text is there in search field, suggestions should come and when field is empty, all the items in list should come.

For former part, oEvent in suggest function is getting fired on every change of search field. But while clearing text (pressing backspace), control is coming to function until last character remains in field. When last character is cleared, oEvent is not getting fired and hence no control to suggest function

Here is the code:

this._oSearchField = new sap.ui.commons.SearchField( {

  enableListSuggest : false,

  enableFilterMode : true,

  enableClear : true,

  startSuggestion : 0,

  width : "100%",

  suggest : function(oEvent) {

       that._updateGlobalDataUIModel(oEvent.getParameter("value"));

  }


  }).addStyleClass("searchField");

How to bring control even when the field is getting empty?
Do I need to add any property other than these? Or can it be version compatibility issue of SAP UI5 with SAP Web IDE?

Kindly help!

Thanks & Regards,

Rhythm Sharma

Former Member
Not what you were looking for? View more on this topic or Ask a question