Quantcast
Channel: SCN : All Content - SAPUI5 Developer Center
Viewing all articles
Browse latest Browse all 6178

Implement suggestion and value help with SearchField

$
0
0

Dear Colleagues,

 

I need a feature both have value help and suggest with searchfield. Suggestion is ok, but when I try to implement the value help feature by opening a dialog box, it always has problems with the search field's setValue method. setValue doesn't work when the dialog box closed. Does the suggestion and value help can't be implement at the same time?

 

I defined the searchfield as bellow:

 

var oSearch = new sap.ui.commons.SearchField("liveSearch", {

  enableListSuggest: true,

  showListExpander: false,

  enableClear: false,

  enableFilterMode: true,

  startSuggestion: 0,

  search: function() {

  if (that.oContextDialog) {

  that.oDialogbox.open();

  } else {

  var oDialogbox = that.fnContextDialogBox();

  that.oDialogbox = oDialogbox;

  that.oDialogbox.open();

  }

  },

  suggest: function(oEvent){

  //updateList(oListBox, oEvent.getParameter("value"));

  var oSearchControl = sap.ui.getCore().byId(oEvent.getParameter("id"));

            var sVal = oEvent.getParameter("value");

          

            if (sVal){                             

                var aSuggestions = filterCountries(sVal); //Find the countries (see example above)

                oSearchControl.suggest(sVal, aSuggestions); //Set the found suggestions on the search control                           

            }   

  }

  });


Viewing all articles
Browse latest Browse all 6178

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>