OutSystems Platform provides automation to create the data model to
store images, and then display them on list and detail screens.
How to Create Entities to Store Images
How to Store Images in the Database
To automatically create an entity to store
images on the database:
- Right click the entity you want to store the image for;
- In the Advanced menu select Import Image
- Select the default image to be displayed when a record doesn't
have an image associated in the database.
A new <EntityName>Picture
entity is created, to store the images on the database. This new entity
has a 1-1 relationship with the entity you chose to import the image.
Displaying Database Images
After creating the entity to store images, you can display the images
from the database in list and detail screens with a single drag-and-drop.
How to Display Database Images on List Screens
To display an image stored on the database:
- Open the list screen and drag the <EntityName>Picture
entity into the Table Records,
- Open the detail screen and drag the <EntityName>Picture
entity into the Form.
If you add an image to a list screen, these are automatically created:
- A column is created with 'Picture' as a label in the header;
- An image is added to the corresponding body cell. At runtime this
widget shows the picture stored in the database.
When adding an image to a detail screen, a container is added to the
- A 'Picture' label;
- An image that at runtime shows the picture stored in the database;
- A link with logic to change the picture.
Creating List Screens from a Template
| Creating Detail Screens from a