C H A P T E R  18

image


<jato:image>

Renders an HTML <img> element.

This tag is only valid when enclosed by both an HTML <form> element and a useViewBean, containerView, or tiledView tag. This tag may not contain any body content.

Example:

<jato:image name="employeePhoto" defaultValue="/images/nophoto.jpg"/>

The above would be rendered into the following HTML:

<img name="PageFoo.employeePhoto" src="...(image URL)...">

Attribute Name

Description

Notes

align

Specifies the position of an IMG with respect to its context.

The following values for align concern the object's position with respect to surrounding text:

  • bottom: means that the bottom of the object should be vertically aligned with the current baseline. This is the default value.
  • middle: means that the center of the object should be vertically aligned with the current baseline.
  • top: means that the top of the object should be vertically aligned with the top of the current text line.
  • left causes the image to float to the current left margin.
  • right causes the image to float to the current right margin.

RTExpr

alt

Specifies alternate text for user agents that cannot display the image

RTExpr

border

Specifies the width of the IMG border, in pixels. The default value for this attribute depends on the user agent.

RTExpr

defaultValue

The value to use, if the DisplayField view peer's value is null.

For an image tag, "value" refers to the value that will be rendered in the HTML img element's src attribute

RTExpr

elementId

Assigns a name to an element. This name must be unique in an HTML document. Please note, this corresponds to the HTML "id" attribute. It has no specific meaning to the JATO framework.

The id attribute has several roles in HTML:

  • As a style sheet selector
  • As a target anchor for hypertext links
  • As a means to reference a particular element from a script

RTExpr

extraHtml

Arbitrary HTML that will be rendered just prior to the closing ">" of this HTML element

RTExpr

height

Image height override. When specified, the width and height attributes tell user agents to override the natural image or object size in favor of these values.

RTExpr

hspace

Specifies the amount of white space to be inserted to the left and right of the IMG. The default value is not specified, but is generally a small, non-zero length.

RTExpr

isMap

Valid values: "true" or "false"

Specifies that the IMG is a server side image map.

When the user activates the link by clicking on the image, the screen coordinates are sent directly to the server where the document resides. Screen coordinates are expressed as screen pixel values relative to the image.

If not specified, "false" is assumed.

RTExpr

longDesc

Specifies a link to a long description of the image. This description should supplement the short description provided using the alt attribute.

RTExpr

name

The name of the DisplayField peer. This peer must be a child of the current parent ContainerView, TiledView, or ViewBean. The DisplayField name is resolved relative to the current parent view.

The view peer may be any subtype of <JATO package>.view.DisplayField

This name may be a qualified view path, using forward slashes ("/") as delimiters. All components in the path except the last must refer to a ContainerView or a derivative of ContainerView (such as TiledView). Both relative and absolute paths are possible. If a name path begins with a forward slash, the name is assumed to be relative to the root view (the ViewBean). If the path does not begin with a forward slash, the name is assumed to refer to a child relative to the current container. Two dots ("..") may be used to refer to the container that is the parent of the current container.

Examples:

/header/orderList/customerName (absolute from root view)

orderList/customerName (relative to current container)

../footer/orderList/customerName (relative to parent)

Req

normalize

Valid values: "true" or "false"

Specifies that the src URL should be automatically normalized. This means that an absolute URL value will have the current servlet context prepended. A relative URL value will not have current servlet context prepended. Both relative and absolute src URL values will also be URL encoded.

If not specified, "false" is assumed.

RTExpr

style

CSS styles to be applied to this HTML element.

RTExpr

styleClass

CSS stylesheet class to be applied to this HTML element.

RTExpr

title

Offers advisory information about this element.

RTExpr

useMap

Associates an image map with an element. The image map is defined by a MAP element. The value of usemap must match the value of the name attribute of the associated MAP element.

RTExpr

vspace

Specifies the amount of white space to be inserted above and below the IMG. The default value is not specified, but is generally a small, non-zero length.

RTExpr

width

Image width override. When specified, the width and height attributes tell user agents to override the natural image or object size in favor of these values.

RTExpr

 

This tag also supports the following JavaScript events:

onBlur, onChange, onClick, onDblClick, onFocus, onKeyDown, onKeyPress, onKeyUp, onMouseDown, onMouseMove, onMouseOut, onMouseOver, onMouseUp, onSelect