Displaying images
If you have access to images in your Web project, you can display them in a data table or elsewhere on a Faces JSP page.
You can drag an Image component to an area of a Faces JSP page or to several other components and then define the image. Note that another way to add images to your Web project is to drag images from the Gallery view into a folder in your Web project.
In the following steps, start with a data table component on your Faces JSP page and a relational record list bound to a table in your database that contains images.
- Add a column for your images to your data table.
- Drag an Image component from the Faces Components drawer into the new column.
- Drag an image field from the Page Data view onto the image component. This action binds the image component to the image field in your database table.
- In the Properties view for the Image component, specify the Type attribute for the image.
- One way to specify the file type of the image is to specify it explicitly in the Type attribute field. Specify it as a correct MIME type (for example: image/gif).
- The other way is to generate your table to include an additional column, which will hold the MIME type of the image (for example: image/gif). Then in the Type field, browse to and select the image type from your data object.
- To control the size of the image when it displays within your data table, enter values for Width and Height.
When you save this page and run it on your server, the image displays in the data table.
Related concepts
Faces components
Data access for Faces components
Data table components
Related tasks
Creating Faces applications - overview
connection, the user of your Web site can read data from an existing data source, write new data to the data source, and update and delete data.">Creating a connection to a relational database
Adding a data table
Managing columns in a data table
Related reference
Faces components reference
Faces attributes reference