cancel
Showing results for 
Search instead for 
Did you mean: 

How to reference a object from oData in UI5?

0 Kudos
372

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.

View Entire Topic

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}"
     })
  }
})
0 Kudos

Hi, thank you! Yes I realized.