23
Views
9
Comments
Solved
Reactive: Set icon from variable

Hello,

Is there a way to dinamically set the Icon from a variable?
I've found an old solution that implied forcing the class in the extended properties of the Icon with "fa fa-"+the name of the icon.

But this is not working, the Icon simply isn't showing. Is there any work around?


Thanks,

Joaquim

mvp_badge
MVP
Rank: #2
Solution

Hi Joaquim,

I just checked, and it's exactly what we do (Traditional Web):

Where the Static Entity "MainEnergieIcons" contains:

mvp_badge
MVP
Rank: #156

Hi Joaquin,

You can use a IF statement in the screen to define the icon.

The point is to have every single Icon available, so that's not really a practical solution!

mvp_badge
MVP
Rank: #2

Hi Joaquim,

The original solution should work, so if it doesn't (seem to), perhaps there's something wrong with your code?

mvp_badge
MVP
Rank: #156

Sample:



mvp_badge
MVP
Rank: #2

Leandro: like Joaquim wrote, that's not a solution if you have a large number of dynamic icons to support.

mvp_badge
MVP
Rank: #2
Solution

Hi Joaquim,

I just checked, and it's exactly what we do (Traditional Web):

Where the Static Entity "MainEnergieIcons" contains:

mvp_badge
MVP
Rank: #2

Glad I could be of help :) Happy coding!