Skip to Content
author's profile photo Former Member
Former Member

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

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

AfterSearch.png (11.3 kB)
AfterOpen.png (6.7 kB)
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Aug 18, 2016 at 09:18 AM

    Hi Cooper,

    Will this sample help? Plunker

    Working Snip:

    Regards,

    Sai.


    Capture.gif (645.5 kB)
    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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 !

  • author's profile photo Former Member
    Former Member
    Posted on Aug 18, 2016 at 08:53 AM

    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



    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.