cancel
Showing results for 
Search instead for 
Did you mean: 

"Suggest" Event for Live Search in SearchField

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

santhu_gowdaz
Active Contributor
0 Kudos

may like this,

Edit fiddle - JSFiddle

Former Member
0 Kudos

Thanks for the reply Santosh!

But liveChange is not working for my code. Could it be SAP UI5 version issue on this again?

Regards,

Rhythm

santhu_gowdaz
Active Contributor
0 Kudos

I'm not sure, may be you are right. which UI5 version you are using?

Former Member
0 Kudos

1.28.7 is the version we are using.

santhu_gowdaz
Active Contributor
0 Kudos

Sorry No idea, It should work for this version.