I have a sap.m.List that I create the list items from a JSON model (named model as "mainMenu"), the model is attached to my JSON view
{
"mainMenu": [{
"title": "Literature",
}, {
"title": "Video",
}, {
"title": "Presentations",
}]
}
To create the list, in my JSON view I use a list template...
var oListTemplate = new sap.m.StandardListItem({
title: "{title}",
type: sap.m.ListType.Navigation,
});
My issue is that I have a i18n resource model set on this view as well.
mainMenu_Literature=Literature
mainMenu_Video=Video
mainMenu_Presentations=Presentations
In my template I can't use...
title: "{i18n>?}"
because I have nothing to put into the ? spot.
What I'd like to do is change my JSON model to...
{
"mainMenu": [{
"title": "mainMenu_Literature",
}, {
"title": "mainMenu_Video",
}, {
"title": "mainMenu_Presentations",
}]
}
Then in the template use...
var oListTemplate = new sap.m.StandardListItem({
title: "{i18n>{mainMenu>/title}}",
type: sap.m.ListType.Navigation,
});
But, of course, that binding syntax is a fantasy.
My my problem is clear, I want to use the value of one model as the key to the second.
Suggestions?
Thanks.