26
Views
6
Comments
Solved
Reactive icon expression?

Hello OS guru's!

I have a question about Icons in reactive.

There is a table where I store a label and also I want to store a selected Icon.

Then when the values are showed in a list the icon should be in the screen.

Only the icon widget requires that a icon is selected instead of from a list.


Solution

Hi Freek,

assuming you are saving the value (class)  of icon (highlighted in yellow color)


Now just use the expression where you want to show the icon and set the properties as below snap (you can also store the "fa-2x" dynamic or static as per requirement):


Hope this helps you.!!

Regards,

LK

Rank: #609
Solution

Hi,

You can give the options to the user to select the icons from the icon name entity of Outsystems(which is in Richwidgets)

Hope that will help you

Cheers,

Rank: #473
Solution

Thnx guys all this information is solving the problem.

I can let the user select the icon from the richwidgets static entity.

Then store that value in the database.

In the screen by the expression show the icon.


Perfecto!

Hi,

1] you take the ICON in that column whichever you want to display

2] Enclose this icon in to IF condition

check that whether you have list / expected value available in that table or not based upon you can write the condition.

If condition TRUE then it will display the ICON

Rank: #473

Hi Shailendra,

Thnx for giving your feedback, but what if I want the user to choose it dynamically and store his option in the database?


Rank: #67

Hi freek,


That is a good question, you have to choose one from the list and behind the scenes, OutSystems will generate an i element with the class of the icon.


Nonetheless, the classes you can control dynamically, like this:


If you use the class like this, it will override the value set on the Icon property and in this way, you can control dynamically (and from the database) the type of icon.

If your label is flag, that CSS would produce the flag icon, if your label is folder, that CSS would render the folder icon, and so on, so forth.

If you want to select the sizes also dynamically, you can also do it with CSS class, for instance fa-2x is the 2x font size.


Hope it helps.


Regards,
João

Rank: #609
Solution

Hi,

You can give the options to the user to select the icons from the icon name entity of Outsystems(which is in Richwidgets)

Hope that will help you

Cheers,

Solution

Hi Freek,

assuming you are saving the value (class)  of icon (highlighted in yellow color)


Now just use the expression where you want to show the icon and set the properties as below snap (you can also store the "fa-2x" dynamic or static as per requirement):


Hope this helps you.!!

Regards,

LK

Rank: #473
Solution

Thnx guys all this information is solving the problem.

I can let the user select the icon from the richwidgets static entity.

Then store that value in the database.

In the screen by the expression show the icon.


Perfecto!