I tried to assign ID to items in my select control using model binding, but ended with an error.
Here is my code:
Model:
{
"languages": [
{
"language": "English",
"locale": "en"
},
{
"language": "German",
"locale": "de"
}
]
}
Select control:
var oLanguageSelection = new sap.m.Select({
name: 'languageSelection',
id: 'languageSelection',
items: {
path: "languages>/languages",
template: new sap.ui.core.Item({
id: "{languages>locale}", //this is the problematic part
text: "{languages>language}",
}),
},
});
Error I get:
Uncaught Error: "{languages>locale}" is not a valid ID.
Is it possible at all to do what I am trying to do - assign element ID using model binding?
Thank you.