Displaying images from attachments at runtime
As a developer or an application business analyst, you can configure a view definition to display images from attachments. The images are displayed in the application.
Use the Image view component to display an image stored in an attachment field. For example, you can display an avatar stored in an attachment field.
Application business analysts can customize the objects developed in their own applications and that are marked customizable by the administrator, but cannot customize the objects developed in com.bmc.arsys in Best Practice Customization mode. For example, objects in core BMC applications like Foundation, Approval, and Assignment cannot be customized in Best Practice Customization mode.
Before you begin
Make sure that you have created an attachment field in the record definition.
To learn more about adding attachment fields, see Creating or modifying regular record definitions.
To add an image view component to a view definition
- Log in to BMC Helix Innovation Studio and navigate to the Workspace tab.
- Select the application to which you want to add the Image view component.
- On the Views tab, click the name of the view definition to which you want to add the Image view component.
- From Palette, drag the Image view component to the canvas.
In the Properties pane, click theSettings icon, and complete the fields as described in the following table:
Record Definition Name
Select the record definition that contains the attachment field in which the image is stored.
Select the attachment field of the record definition in which the image is stored.
Click Edit to build an expression that points to the record instance ID.
Horizontal Alignment Select the appropriate alignment for the image. Maximum WidthDefault value—The original width of the image.Specify the maximum width for the image in pixels or percentage.
Note: If these fields are blank, the image is displayed by using its original dimensions.
Hidden Select if you want to hide this field.
To verify the view definition, click Preview.
After configuring the Image view component, the following conditions describe how the image is rendered:
- Attached image is valid—Image is displayed correctly.
- Attached image is invalid—Image is not displayed. An icon indicating broken image is displayed.
- Attachment is absent—Image is not displayed.