Image

Definition

Displays a bitmap in GIF or JPEG format. The width and height of the image can be specified.

  • alt

    Defines an alternative text for the 'src' attribute. If the 'src' bitmap cannot be found or opened (for example, unrecognized graphic format) the 'alt' text is displayed with an red X in front of it and surrounded by a frame indicating the bitmap size.

    If no 'tooltip' attribute is set for the image the alternative text is displayed as the mouse cursor passes over the image, or as the mouse button is pressed but not released.

  • height

    Defines the height of the bitmap. If 'height' is omitted the height of the image is determined by the bitmap itself.

  • hoverMenuId

    Defines which hover menu is displayed for this tree node. You can define different trigger methods to display the hover menu. For more details, see hover menu.

  • id

    Identification name of the image.

  • imageMapId

    Identification name of the imageMap control that is associated with the image. The imageMap control allows you to define areas on the image that are clickable. The areas can be associated with a link or an event. For more details on imageMap, see imageMap control description.

  • src

    Name of bitmap (=source). The name of the bitmap is case sensitive. To have access to MIME delivered with the portal see "accessing MIME". The images are usually stored in the public resource path of the component in the subfolder /images. The public resource path can be determined with the JSP command:

    <% String PublicURL = componentRequest.getPublicResourcePath(); %>

    You can also get the complete path to image include the subfolder /mimes with the command:

    <% String ImageURL = componentRequest.getPublicResourcePath() + "/../mimes/"; %>

Another possibility is to get the full URL of the image and set the src attribute in a scriptlet.

<%

IResource rs = componentRequest.getResource(IResource.IMAGE, "../mimes/mypicture.gif");

image.setSrc(rs.getResourceInformation().getURL(componentRequest));

%>

  • tooltip

    Defines the hint of the image which is displayed as the mouse cursor passes over the image, or as the mouse button is pressed but not released.

  • width

    Defines the width of the bitmap. If 'width' is omitted the width of the image is determined by the bitmap itself.

Attributes

M

Values

Usage

alt

*

String

Taglib alt="Walldorf picture"

Classlib setAlt ("Walldorf picture")

height

 

Unit

Taglib height="150"

Classlib setHeight="150"

hoverMenuId

 

String

Taglib hoverMenuId="imgHover1"

Classlib setHoverMenu (HoverMenu menu)

id

*

String (cs)

Taglib id="Hometown"

Classlib setId("Hometown")

imageMapId

 

String (cs)

Taglib imageMapId="imageMap"

Classlib setImageMap("imageMap")

src

*

String (cs)

Taglib src="<%=ImageURL+\"wdf.jpd\" %>"

Classlib setSrc (ImageUrl + "wdf.jpg")

tooltip

 

String

Taglib tooltip="center of ebiz"

Classlib setTooltip ("center of ebiz")

width

 

Unit

Taglib width="300"

Classlib setWidth ("300")

Example

using the taglib

<hbj:imageid= "Logo" tooltip= "centerofebiz" width= "70" height= "35" alt= "picturesaplogo.gif" src= "<%=ImageURL+\"saplogo.gif\"%> />

using the classlib

IPortalComponentRequestrequest=(IPortalComponentRequest) this .getRequest();Formform=(Form) this .getForm();Imageimage= new  Image(request.getWebResourcePath()+ "/../mimes/saplogo.gif" , "picturesaplogo.gif" );image.setTooltip( "centerofebiz" );image.setWidth( "70" );image.setHeight( "35" );form.addComponent(image);

Result