Skip to Content
avatar image
Former Member

Dynamic Icon in table

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Feb 13, 2017 at 11:52 AM

    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

    Add comment
    10|10000 characters needed characters exceeded