Quantcast
Channel: SCN : All Content - SAPUI5 Developer Center
Viewing all articles
Browse latest Browse all 6178

Conditional Icon in BindAggregation (ODataModel)

$
0
0

Hello,

 

I am working on a SAPUI5 Mobile Application prototype, and wish to have a conditional icon in the list.I am working with ODataModel to get the data form the server.

 

list.bindAggregation("items", {

                  path:"/CollectionName",

                  template: new sap.m.StandardListItem({

                      icon: sap.ui.core.IconPool.getIconURI('accept'),

                      type : sap.m.ListType.Navigation,

                      title: '{Parameter1}',

                      description: '{Parameter2}',

                      info: '{CurrentParameter3}',

                      tap: function(evt){}

})

 

});

 

Based on the value of a Parameter4 i wish to dynamically pass the icons in the list, so effectively it will be

 

if (Parameter4 = "Somthing") {

 

icon : sap.ui.core.IconPool.getIconURI('accept')

 

} else {

 

icon : sap.ui.core.IconPool.getIconURI('alert)

 

}

 

Many Thanks in advance

Nikhil


Viewing all articles
Browse latest Browse all 6178

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>