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.

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.

  1. Add a column for your images to your data table.

  2. Drag an Image component from the Faces Components drawer into the new column.

  3. 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.

  4. In the Properties view for the Image component, specify the

    Type attribute for the image.

    1. 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).

    2. 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.

  5. 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.