on 01-01-2017 11:23 AM
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
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);
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Better way it to create array of objects for adding multiple tokens to MultiInput Field
var MultiInput = sap.ui.getCore().byId("<Place id of your multiinput field");
var otoken1 = new sap.m.Token({
key: "001",
text: 'SAP'
});
var otoken2 = new sap.m.Token({
key: "002",
text: 'CLIENT'
});
this.aTokens = [otoken1, otoken2];
MultiInput.setTokens(this.aTokens);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
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.