cancel
Showing results for 
Search instead for 
Did you mean: 

sap.m.SelectDialog search doesn't fire on open

Former Member
0 Kudos

I have a sap.m.Input that opens a sap.m.SelectDialog, passing a search string as so:

valueHelpRequest: function () {

                                   oSelectDialog1.open(sap.ui.getCore().getElementById("SyncSiteDataSite1").getValue());

                               }

when the search dialog opens, the search string is populated with the content of the Input, as I would expect, but the search doesn't actually fire - it is necessary to click the search icon to filter the items in the SelectDialog. Is this by design or is something broken ?

Either way how can I force the filter to be applied as soon as the SelectDialog opens ?

The pictures show the SelectDialog after it has opened and after the search button is pressed. "iel" is the string from the Input.

Martin

Accepted Solutions (1)

Accepted Solutions (1)

saivellanki
Active Contributor
0 Kudos

Hi Cooper,

Will this sample help? Plunker

Working Snip:

Regards,

Sai.

Former Member
0 Kudos

Sai,

It certainly will !

It was the fireSearch I was missing:

valueHelpRequest: function () {

              oSelectDialog2.open(sap.ui.getCore().getElementById("SyncSiteDataSite2").getValue());

              var oDialogDOM = oSelectDialog2.$();

              var oSearchFieldDOM = oDialogDOM.find('.sapMSF');

              var oSFID = oSearchFieldDOM[0].id;

              var oSearchField = sap.ui.getCore().byId(oSFID);

              oSearchField.fireSearch();

          }

It works now . Thanks !

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

you can use LiveChange on Search  - JsDoc Report - SAP UI development Toolkit for HTML5 - API Reference - sap.m.SearchField

This event is fired when the value of the search field is changed by a user.


Thanks,

Chandan



Former Member
0 Kudos

I already tried that but it doesn't help - LiveChange doesn't fire when the SelectDialog opens. You have to actually type something else in the search box to make LiveChange fire, which is no better than just clicking search.