on 2021 Apr 28 8:32 AM
Hello,
I have this code in UI5 application,
new sap.m.List({
mode: sap.m.ListMode.SingleSelect ,
items: {
path: "/ROLES",
template: new sap.m.StandardListItem({
highlight: {STATE},
title: "{NAME}",
description: "{TEXT}",
icon: "{STATUS_ICON}"
})
}
})
so all go fine until I set the parameter 'highlight' before reference it to my oData parameter STATE I saw that It works if I set like this.
highlight: sap.ui.core.MessageType.Error //(without quotes)!
but when I want to set it dinamically referenced for every entry I don't know how to do it because if I write
highlight: "{STATE}"
of course it gives me error because the program interprets it as string.
Any suggestion?
Thanks in advance.
Hi boyan,
I just tried with the code provided by SDK sample:
Added below properties in /mockdata/products.json
"State": "Error"
Add then added the highlight property in view:
<StandardListItem
title="{Name}"
highlight = "{State}" />
It's working well:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It worked fine! Thank you. I was writing 'sap.ui.core.MessageType.Error' as STATUS value and due to this didn't work.
Hi Boyan
While binding it with "{STATE}" parameter , only the value "Error" should be passed.
new sap.m.List({
mode: sap.m.ListMode.SingleSelect ,
items: {
path: "/ROLES",
template: new sap.m.StandardListItem({
highlight: "Error",// "Information","None","Warning"
title: "{NAME}",
description: "{TEXT}",
icon: "{STATUS_ICON}"
})
}
})
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
58 | |
10 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.