Skip to Content

Dynamic Icon in table

Feb 11, 2017 at 11:46 AM


avatar image
Former Member

Hi Friends,

when I use the code like below the Table shows the Pictures in the rows for this path

"name =" or

"name = images/print.gif"

var oImage = new sap.m.Image(SFId, {     
src :  "{" + name + "}" ,            

But it does not work for Icons like "name = sap-icon://group" . It only does not work in table. But then I use it for Buttons it works.

var icon = sap.ui.core.IconPool.getIconURI(name);

Any hints will be apreciated.


10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Akhilesh Upadhyay Feb 13, 2017 at 11:52 AM


I think you dont need to put icon inside {}, you can check as below:

"name = sap-icon://group";
var oImage =newsap.m.Image(SFId,{     
 src :"+ name +" , 


you need to get that icon value in data itself, whether modify your data in UI or get data with icon from backend itself and bind image in table like below:

say you have iconValue field in your data

var oImage =newsap.m.Image(SFId,{     
src :"{iconValue}" , 



10 |10000 characters needed characters left characters exceeded