You can drag the Standard JavaServer Faces Image component from
the Palette to the Visual Designer to add an image, such as a
JPEG or GIF file, to a Visual Web JSF page. When you drop the image on your
page in the Visual Designer, you see a dialog box that you can use
either to locate the image file in your filesystem or to enter
a URL (if you click the URL tab at the top). If you navigate
to an image file and click OK, the image file is copied to the
project, and you can see it in the Projects window under project-name > Web Pages > resources.
This component is a JavaServer Faces reference implementation that cannot use themes. The Image component in the Basic category of the Palette does support themes and provides other features that improve ease of use.
After dragging the component to the Visual Designer, you can do a number of things
with it:
Drag the component to another location on the page.
Select the component and edit its properties in the Image
Properties window. If necessary, right-click the component and choose
Properties to display the Properties window. Some typical properties
you might set are:
id. The name of the Image component. In the
JSP file, this name is the value of the component's id
attribute. In the page bean, this property's value is
the name of the HtmlGraphicImage object.
alt. The alternate text for the image. The alt
text describes the graphic element in the HTML page, is
readable by screen readers, can display as a tool tip,
and displays when the user has display of images turned
off in the web browser. Same as the HTML attribute alt
of the <img> tag.
value. The path to the image file, such
as /resources/image-file.gif, or a URL that points
to an image, such as
.
Right-click the Image component and choose one of
the following options:
Bind to Data. Dynamically set the image that is displayed. You can bind the component's value property to an object or a data provider, as described in the topic Bind to Data Dialog Box.
Property Bindings. Opens a dialog box that enables you to bind properties of the component in addition to the value property to other objects or bean properties that update this component's properties automatically.