JSF Standard Hyperlink Component
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 Navigator 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 Navigator 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
Properties window. 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 Properties window. The most useful thing you can do in the Properties window 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 Navigator 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.
- Add Binding Attribute. This option adds a binding attribute to the component.
- Note: If you plan to script the component in Java code, you must manually add a binding attribute, which is bound using a value binding expression to a property of the backing page bean.
- Remove Binding Attribute. This option removes the binding attribute from the component.
- See Also
- Working
With Components
- Component
Tasks: Quick Reference
- About the Visual Web Palette
Legal Notices