Link - Command
Creates a hyperlink on the page. It can be used to navigate to other pages or programmed to perform a client-side or server-side action. Selecting this component adds the hyperlink component and associated output text, that is a separate editable component.
Component at design time
Drag and drop an
Link - Command component onto the page:
The
Link - Command component looks like this on the page:
Component at runtime
The
Link - Command component looks like this on the page during runtime:
Properties and All Attributes views
The Properties view for a component shows the most common set of attributes you can set on a component, and, depending on the component, you might also see options for adding controls, actions, or other components. To open the Properties view, click
Window | Show View | Properties.
These common attributes for the Link - Command component display on the h:commandLink, Parameter, and Accessibility tabs in the Properties view. See the All Link - Command attributes table for a complete list of attributes. Additional configuration options to add parameters and actions are on theh:commandLink and h:commandLink>Parameter tabs:
Configuration option
Description
Add the parameters that are passed to the action
Specifies what parameters are passed to the action by the component.
Click to code the action this link performs
Switches to the Quick Edit view so that actions for the hyperlink to perform may be programmed. Additionally, rules can be defined based upon the actions and outcomes returned.
The All Attributes view shows a table of all the attributes you can set on a component, which includes those attributes you can access from the Properties view. To switch to the All Attributes view, click the
All Attributes icon in the upper right corner of the Properties view.
Table 1. All Command hyperlink attributes Attribute name
Represented in Properties view by
Description
accesskey
Accessibility>Access Key
Specifies a single keyboard key as an access key. Pressing the specified access key at runtime gives focus to this component. Pressing ALT plus the specified access key at runtime gives focus to this component (or executes the component if it is a kind of button).
action
Not represented
Specifies the value returned when the component is clicked. The value is passed to the default NavigationHandler, that then matches the value against a set of navigation rules defined in the application configuration file.
actionListener
Not represented
An expression that points to a method with an ActionEvent argument and a
"void" return type.
binding
Not represented
An expression that binds the component's instance (usually a user interface component) to a bean property (usually in the backing file).
charset
Not represented
The character encoding of the resource designated by the hyperlink.
coords
Not represented
The position and shape of the hot spot on the screen (for use in client-side image maps).
dir
Not represented
Specifies the component's direction when rendered at runtime. The values can be either:
If the direction is not specified, a direction appropriate to the encoding of the component is used.
- ltr - left to right
- rtl - right to left
hreflang
Not represented
The language code of the resource designated by this hyperlink.
id
ID
Assigns a name to a component. Should be a unique name within a JSP.
immediate
Not represented
If true, skip straight to render phase of life cycle.
lang
Not represented
The language of the component's value(s) and text content. If omitted, the language is inherited from the containing tags (notably the view. Specified as an ISO-standard language abbreviation code. For example, "en" for English, "en-US" for American English, "fr" for French, "de" for German.
Note: This does not "translate" the text in the component, rather, it identifies the language of the component so that operations such as searching, sorting, collating and the like are done correctly.
rel
Not represented
The relationship from the current document to the anchor specified by this hyperlink. The value of this attribute is a space-separated list of link types.
rendered
Not represented
Can be set to true or false:
- false - Component will not be rendered to the browser at runtime.
- true - Component will get rendered. This is the default value.
rev
Not represented
A reverse link from the anchor specified by this hyperlink to the current document. The value of this attribute is a space-separated list of link types.
shape
Not represented
Sets the shape of the link:
- rect
- circle
- poly
styleClass
Style: Classes
Space-separated list of CSS style classes to be applied when this element is rendered. This value must be passed through as the class attribute on generated markup. Defines the classes (such as style sheets) of the selected component. This may be done manually, or by clicking the button and selecting the desired Classes from within the window.
style
Style: Props
Specifies CSS style information for the component (for example, style="font-size : 8pt ; color : red"). Defines the properties (such as font and color) of the selected component. This may be done manually, or by clicking the button and selecting the desired properties from within the window.
target
Not represented
Assigns the target frame within a frameset that a page should be loaded into when the hyperlink is clicked:
- New Window
- Same Frame
- Parent Frame
- Full Screen
tabindex
Accessibility>Tab order index
Specifies the position of the component in the tabbing order in the JSP. This value must be a number between 0 and 32767.
title
Accessibility>Title
Specifies the title text, shown in browser as a tooltip at runtime. Used by a browser as the alternative text of a component if the alternative text is not specified.
type
Not represented
Specifies the button type, either
Submit,
Reset, or
Plain .
value
Not represented
Specifies the document to which the link is connected. This can be a String containing the document filename or it can be the binary data of the document. Specifying binary data is done in conjunction with setting the mimetype attribute. The value can be a String(Base64 encoded), a byte[], or a java.io.InputStream object. When specifying binary data the value binding expression must be able to be evaluated on its own in a subsequent request back to the server by the browser for the document.