cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic Icon in table

joerg_arndt
Participant
0 Kudos

Hi Friends,

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

"name = http://25.media.tumblr.com/tumblr_llahls2IeS1qjmniro1_250.gif" 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.

Rg.Joerg

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member227918
Active Contributor
0 Kudos

Hello,

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 +" , 
});

OR,

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}" , 
});

Thanks,

Akhilesh