Skip to Content
avatar image
Former Member

How to set array as tokens to multi input control?

Hi Experts,

I have an array where i am trying to set the array values as tokens to the multiinput control but could nt. The code i am trying with is in https://plnkr.co/edit/SJWN9qZwE2uSFZiqJIQ8?p=preview

Any suggestions to add the values in array as tokens to multi input control

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Jan 01, 2017 at 01:36 PM

    Hi Michael

    Hope this helps you : https://plnkr.co/edit/hbKhBWYrYCVt3qD6q0J7?p=preview

    Regards

    Shubhang

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 16 at 07:28 AM

    Hello,

    If you would like to avoid setting tokens by model, you can manually add them this way:

    for(let i = 0; i < data.RESULT.length; i++){
        // For each result create new token and append it to the MultiInput field.
        // Token instance
             var defToken = new sap.m.Token({
                 text: data.RESULT[i]
             });
        // Add created token to the Plant field
    	 yourMultiInputField.addToken(defToken);
        }
    
    Add comment
    10|10000 characters needed characters exceeded