Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

SAPUI5 - Changing icon color within ObjectListItem


I want to keep the same icon and only change the color depending on the status field.

In this way as described below, it definitely does not work. I think I have to use CSS but I have no idea how I can address CSS style. Unfortunately, the method addStyle does not apply to this case.

items: {


template: new sap.m.ObjectListItem({

type: "{device>/listItemType}",

press: [oController.handleListItemPress, oController],

intro : "{REPORT_CATEGORY}",                           

icon : {

path : "STATUS",

formatter : function(myStatus) {


return sap.ui.core.IconPool.getIconURI({

src: "sap-icon://activity-items",

color: "#2DFA06",  //green


return sap.ui.core.IconPool.getIconURI({

src: "sap-icon://activity-items",

color: "#FC0519", // red





Any suggested solution?

Many thanks,


Former Member
Former Member replied

Hi Fouad.

Like this? Example


2 View this answer in context

Helpful Answer

Not what you were looking for? View more on this topic or Ask a question