See Also
You can drag the Standard JavaServer Faces Hyperlink
component
from the Palette's Standard category to the Visual Designer to create a standard hyperlink to a URL.
When the web page is generated, the Hyperlink becomes an HTML <a>
element.
After dragging the component to the Visual Designer, you can do a number of things
with it:
- Select either the text element (inner part) or the hyperlink
element (outer part). This component is composed of an HtmlOutputHyperlink
and an embedded HtmlOutputText component. Depending
on where you click this component in the Visual Designer, you
get different Properties windows. You use the HtmlOutputHyperlink
to set the link part of the component, and the HtmlOutputText
part to set the text of the link.
When this composite component is selected in the Visual Designer, you see it in the Outline window, and you can
see which part of the component you have selected. The hyperlink
is
the main node of the component, and the hyperlinkText
is
a subnode. You can also use the Outline window to select either part of the component and work
with the selected component part's properties.
- Select the component drag it to another location on the
page.
- Select the inner, hyperlinkText
part of the component and start typing to change the displayed
text.
- Select the component and edit its properties in the Hyperlink
property
sheet. Some typical properties you might set are:
- id. The name of the Hyperlink. In the JSP file,
this name is the value of the id attribute. In
the page bean, this property's value is the name of the
HtmlOutputHyperlink object.
- value. The URL for the hyperlink's target document
or resource.
- Select the inner, hyperlinkText
part of the component and edit its properties in the Output
Text property
sheet. The most useful thing you can do in the property
sheet is to set the visible label (or link text) for the component
in the value property. You can also bind the Output Text component
to a table and set the label dynamically.
- Right-click the Hyperlink component in the Outline window and choose one of several
actions:
- Bind to Data. Dynamically set the text that displays for the link. 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
vlaue property to other objects or bean properties that update this component's properties automatically.
- See Also
- Working
With Components
- Component
Tasks: Quick Reference
- Component
Web Tutorials
- Data
Source Web Tutorials
- About the Palette