The Image Hyperlink create an image that links to a URL. The image hyperlink can display both text and an image.
This component has support for client-side JavaScript functions that enable you to perform actions on the client without a trip back to the server. For more information on this advanced feature, choose Help > Javadoc Reference > Project Woodstock 4.2 Tag Library and navigate to webuijsf:imageHyperlink.
To set the image for the Image Hyperlink component, you can right-click the component and choose Set Image. You then see a dialog box that you can use to specify the image in three ways:
Choose File. You can navigate to a file in your filesystem and click OK. The image file is copied to the project, and you can see it in the
under project-name > Web Pages > resources. Choosing this option sets the Image component's url property to /resources/image-file.
Enter URL. Enter a URL to a web location for the file. For example, enter the following URL:
.
Choosing this option sets the Image component's url property to the URL you entered.
Set Theme Icon. Displays a list of icons that are in the theme associated with your application. Select an icon name in the list to see it displayed in the dialog box. Choosing this option sets the Image component's icon property to the icon name you chose.
If the url property has already been set, choosing an icon does not change the appearance of the component, because the url property takes precedence over the icon property. For the icon to be visible, the url property must not be set.
You can drop an Image component or a Static Text component or both on the Image Hyperlink if you want to customize the appearance of the link.
If you drop a component on the Image Hyperlink, you embed the component in the hyperlink, and you must work with the embedded component's properties rather than the properties of the Image Hyperlink. Select the embedded component in the
to set the embedded component's properties.
Other than the extra support for an image, an Image Hyperlink is essentially the same as a Hyperlink component. As with the Hyperlink component, if you set the action property and do not set the url property, the page is submitted. If instead you set the url property, the link is a normal hyperlink that sends the browser to a new location, does not submit the page, and ignores any action property setting. You set the component's properties in its Properties window.