60
Views
8
Comments
Solved
How to use static entity records icon?

Hi Everyone,

I am new to OS. Working on O11. I have a static entity and I have assigned a custom icon to each record of the entity. How can I show these icons instead of record labels in dropdown and tables?


Regards,

Rahul Singhal

2024-09-12 02-43-38
Deepsagar Dubey
Solution

Hi @Rahul Singhal 

I am not aware to any way to fetch static entity record icon but I would suggest to put the icons on the images folder section. After that create a IconURL field on the static entity and pass URL path of the correspondent icon to that field. 

I hope it'll help you

Thanks
Deep

UserImage.jpg
Rahul Singhal

Hi @Deepsagar Dubey, Thanks for the response but how are you getting the URL for an image, uploaded in image folder. Is it the 'Runtime Path' of the image? Though I used the runtime path but it did not work.

2024-09-12 02-43-38
Deepsagar Dubey
Solution

Hi @Rahul Singhal 

1. Go to Images folder in your Interface tab and import image 



2. Go to static entity and add an entity attribute named IconURL (Data Type - Text) and for each record in entity add corresponding IconURL

 

3. In your screen or table use OS image element and select Type property to external URL and pass IconURL in URL


I hope it'll help you.

Thanks
Deep

2024-09-12 02-43-38
Deepsagar Dubey
Solution

Hi @Rahul Singhal 

1. Go to Images folder in your Interface tab and import image 



2. Go to static entity and add an entity attribute named IconURL (Data Type - Text) and for each record in entity add corresponding IconURL

 

3. In your screen or table use OS image element and select Type property to external URL and pass IconURL in URL


I hope it'll help you.

Thanks
Deep

2023-01-27 13-47-30
Ahmad Aqil

Hi Rahul,

To show the icon in table you can simply use Icon widget and you can set it like this :

For dropdown, you can use DropdownSearch widget that have option to set image url  or icon class.


Status.Icon is an attribute that hold the value for icon class name.For instance, fa-check.


Please find the attached oml file for your reference.


Regards,

Aqil



DemoApp.oml
UserImage.jpg
Rahul Singhal

Hi @Ahmad Aqil, Thanks for the response. In the demo, you are using icon which is already available in OS. How can I use a custom icon/image or how can I add new icon to OS studio?

2023-01-27 13-47-30
Ahmad Aqil

Hi Rahul,

Here is the updated oml file, in this application here are the steps required :

  1. Import new icon as resource ( make sure to use small size as possible to avoid huge resource in the app)
  2. Set Deploy To Target directory
  3. Add new attribute CustomIconURL in the static entity 
  4. Set the value using runtime Path to the respective icon
  5. Use image widget to display icon in table
  6. Use dropdownsearch and set ImageURL to display the icon

Regards,

Aqil

DemoApp.oml
2024-09-12 02-43-38
Deepsagar Dubey
Solution

Hi @Rahul Singhal 

I am not aware to any way to fetch static entity record icon but I would suggest to put the icons on the images folder section. After that create a IconURL field on the static entity and pass URL path of the correspondent icon to that field. 

I hope it'll help you

Thanks
Deep

UserImage.jpg
Rahul Singhal

Hi @Deepsagar Dubey, Thanks for the response but how are you getting the URL for an image, uploaded in image folder. Is it the 'Runtime Path' of the image? Though I used the runtime path but it did not work.

2024-09-12 02-43-38
Deepsagar Dubey
Solution

Hi @Rahul Singhal 

1. Go to Images folder in your Interface tab and import image 



2. Go to static entity and add an entity attribute named IconURL (Data Type - Text) and for each record in entity add corresponding IconURL

 

3. In your screen or table use OS image element and select Type property to external URL and pass IconURL in URL


I hope it'll help you.

Thanks
Deep

UserImage.jpg
Leon Holmes

Useful function. Thanks. 


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.