cancel
Showing results for 
Search instead for 
Did you mean: 

Duplicate Tokens collected in MultiInput with ValueHelp

0 Kudos

I am trying to use a multiinput with Valuehelp dialog and observed that duplicate tokens being collected from valuehelp dialog. Tried to see explored example and observed the same behaviour there as well.

https://sapui5.hana.ondemand.com/#/entity/sap.m.MultiInput/sample/sap.m.sample.MultiInputValueHelp

Ex: first i select "ITelO Vault" & "Notebook Basic 19" and click on button "Select". Later tokens get collected in Multiinput. Again if i use value help dialog and again i can select "ITelO Vault".

How can we validate the token if already at Multiinput or even at the time of collecting to multiinput, can we delete duplicates ? Possible ?

Accepted Solutions (0)

Answers (2)

Answers (2)

maheshpalavalli
Active Contributor

You have to do this manually, you can see sap is directly adding the tokens without checking if the token with the key already exists.

Use basic javascript to check if the selected token already exists like below, enhance the below code and add token if the key is not found.

Note: if you use smart input controls then they will automatically take care of this, but I am not sure if it possible for you to use the smart controls in your app.

// Dummy code.
var exists = list.some(function(elem) {
      return elem === obj
    })
SilvanoSilva
Explorer
0 Kudos

I have a value help using annotations getting data from multi origin, is there a way to remove duplicates keys?

The result is showing all lines from all backend systems