on 09-03-2017 12:39 PM
Hi.
I have Multi Input where I am applying tokens to the control. So tokens have key and text properties. Previously I used key as integer and text as user input. The MutiInput tokens can change based user selection. I am storing tokens in model and applying it when user navigates to the same multiinput. Here the duplicate id error occuring. I replaced key value as User text value. But still I am getting the duplicate error. Have anyone came across this situation?
Code:
var sFrenchToken = mId.getTokens();
var getKey = sFrenchToken.getProperty("key");
var getTxt = sFrenchToken.getProperty("text");
var arr = [];
arr.push({ text: getTxt, key: getTxt});
var oModelEn = new sap.ui.model.json.JSONModel(arr);
<MultiInput id="mId" tokens="{oModelEn>/}">
<tokens> <Token key="{oModelEn>key}" text="{oModelEn>text}"/> </tokens> </MultiInput>
Error : adding element with duplicate id '__token0-__xmlview3--"id of my control"-0'
Hi Karthik,
I would suggest you to do the way as Yogesh said.
Though i didn't get id error, i could see the code broke at the second line.
You may replace with,
var getKey = sFrenchToken[0].getProperty("key");
var getTxt = sFrenchToken[0].getProperty("text");
Regards,
Ravikiran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Looks like you are trying to get the tokens from the control, take the data from them, and then bind the data to the same control again.
Why not use only one approach? Either bind and get the data from the model or use the control methods to get / add tokens.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.