3 weeks ago
Hello everyone!! I need to get the SuggestedItem selected by a user within a SearchField, but specifically, I need to get the key associated with the SuggestedItem selected by the user. Here is the code for my view:
<SearchField
enableSuggestions="true"
enabled="true"
placeholder=""
showRefreshButton="false"
showSearchButton="true"
suggestionItems="{path: '/ExampleSet'}"
suggest=".onSuggest"
value=""
visible="true"
width="auto"
tooltip="Buscar empleado"
id="searchField"
change="onSeleccionado"
suggestionItemSelected="suggestionItemSelected"
>
<suggestionItems>
<SuggestionItem text="{Sname}" key="{Pernr}" description=" {Pernr}"/>
</suggestionItems>
I tried with suggestionItemSelected but the event is not triggered. How can I get the key of the SuggestionItem?
Hi, you can use the search event, it should give you the selected SuggestionItem.
Then get the key with the getKey function of the item.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
66 | |
10 | |
10 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.