Skip to Content
0

Dynamic Icon in table

Feb 11, 2017 at 11:46 AM

58

avatar image

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

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
0

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

Share
10 |10000 characters needed characters left characters exceeded