Image
Displays a graphic (usually a GIF or JPEG file). It can use a local or remote image file. It may also be bound to data storage, such as a database or a bean.
Component at design time
Drag and drop an
Image component onto the page:
The
Image component looks like this on the page:
Component at runtime
The
Image component looks like this on the page during runtime:
Properties and All Attributes views
The Properties view for a component shows the most common set of attributes you can set on a component, and, depending on the component, you might also see options for adding controls, actions, or other components. To open the Properties view, click
Window | Show View | Properties.
These common attributes for the Image component display on the hx:graphicImageEx and Accessibility tabs in the Properties view. See the All Image attributes table for a complete list of attributes.
The All Attributes view shows a table of all the attributes you can set on a component, which includes those attributes you can access from the Properties view. To switch to the All Attributes view, click the
All Attributes icon in the upper right corner of the Properties view.
Table 1. All Image attributes Attribute name
Represented in Properties view by
Description
accesskey
Not represented
Specifies a single keyboard key as an access key. Pressing the specified access key at runtime gives focus to this component. Pressing ALT plus the specified access key at runtime gives focus to this component (or executes the component if it is a kind of button).
align
Alignment
Specifies the alignment for the component:
- left
- center
- right
- relative
alt
Accessibility>Alternate Text
Specifies alternate text for a component. The alternative text is displayed when the element cannot be rendered normally, for example, in browsers that do not support forms and in browsers set to not display images.
binding
Not represented
An expression that binds the component's instance (usually a user interface component) to a bean property (usually in the backing file).
border
Border
Specifies, in pixels, the size of the border for the image.
dir
Not represented
Specifies the component's direction when rendered at runtime. The values can be either:
If the direction is not specified, a direction appropriate to the encoding of the component is used.
- ltr - left to right
- rtl - right to left
height
Size: Height
Specifies the height of the component in either pixels or percentage. To specify percentage, append % to the value.
hspace
Margin: Horizontal
Specifies the amount of white space in pixels to be inserted to the left and right of the component.
id
ID
Assigns a name to a component. Should be a unique name within a JSP.
ismap
Not represented
If set to true, the image component is set to use a Server Side image map. Note that the graphic component must be contained within a hyperlink component.
lang
Not represented
The language of the component's value(s) and text content. If omitted, the language is inherited from the containing tags (notably the view. Specified as an ISO-standard language abbreviation code. For example, "en" for English, "en-US" for American English, "fr" for French, "de" for German.
Note: This does not "translate" the text in the component, rather, it identifies the language of the component so that operations such as searching, sorting, collating and the like are done correctly.
longdesc
Not represented
Specifies a link to a long description of the image. This description should supplement the short description provided using the alt attribute.
mimeType
Type
Used for declaring the media MIME type when src is bound to binary data.
rendered
Not represented
Can be set to true or false:
- false - Component will not be rendered to the browser at runtime.
- true - Component will get rendered. This is the default value.
styleClass
Style: Classes
Space-separated list of CSS style classes to be applied when this element is rendered. This value must be passed through as the class attribute on generated markup. Defines the classes (such as style sheets) of the selected component. This may be done manually, or by clicking the button and selecting the desired Classes from within the window.
style
Style: Props
Specifies CSS style information for the component (for example, style="font-size : 8pt ; color : red"). Defines the properties (such as font and color) of the selected component. This may be done manually, or by clicking the button and selecting the desired properties from within the window.
tabindex
Not represented
Specifies the position of the component in the tabbing order in the JSP. This value must be a number between 0 and 32767.
title
Accessibility>Title
Specifies the title text, shown in browser as a tooltip at runtime. Used by a browser as the alternative text of a component if the alternative text is not specified.
url
Not represented
Specifies the URL the component should use.
value
File
Specifies the file to be used by the component. The value can be a String (file content will be Base64 encoded), a byte[], or an object.
vspace
Margin: Vertical
Specifies the amount of white space, in pixels, to be inserted to the top and bottom of the component.
width
Size: Width
Specifies the width of the component in either pixels or percentage. To specify percentage is to be used append % to the value.