Link
amx:commandLink, amx:goLink
There are two versions of Link components that can be embedded within a page:
- Command Link: Creates a link that, when tapped, will generate an action event. The commandLinks are used for task flow navigation and behave similar to commandButtons.
- Go Link: Creates an anchor or hyperlink that behaves similar to a web browser link.
This component is commonly used on tablets and phones.
Appearance
Appearance characteristics for this component.
Both Command Links and Go Links have the same visual appearance. There is different styling for links when placed inside a Form than when place in on the background content area (i.e. outside the Form).
Inside Form
- Background: The link sits against a white background of a Form or List View.
- Caret: The link may or may not have a caret following it.
- Color: The link is blue color.
Outside Form
- Background: The link sits against a page background.
- Caret: The link may or may not have a caret following it.
- Color: The link is blue color or white color in Springboard.
On Component
- Child Component:strong Links maybe also be associated with a child component. The link will display around that component.
- Images: It is common to put a link on an image, so tapping the image will be a link.
Behavior
Common behaviors for this component.
- Command Link: Tapping a Command Link will perform an action similar to a Command Button.
- Go Link: Tapping a Go Link will jump the user to the address or anchor specified.
Usage
Usage guidelines for this component.
- A combination of link types can be used within a page.
- Use commandLinks for task flow navigation. A commandLink may also contain a child image component to create a link that displays an image rather than text.
- Use goLinks for linking to URL pages or for operations such as making a call.
- Ensure that the purpose of each link can be determined from the link text. Never use terms such as "Click Here" or "Click Link" which do not indicate why a user should do so.
- Avoid using links where the linked text is only one character long, as this provides too small a tap target for the user. When it is unavoidable to have a one-character link add non-breaking spaces (the " " character) at the beginning and end of the linked text to provide a larger target area.
- Links may perform similar functions to buttons. In order to maintain cross-application consistency, observe these distinctions:
- Buttons should be used to perform a task, or navigate a user to a dialog or page where the task can be performed.
- A link may consist of a specific object name, such as "Bob Smith", whereas button labels should always be generic terms, such as "Submit" or "Create Invoice".
Sample
AMX sample code for this component.
The following is a sample code for a commandLink:
<amx:commandLink id="cl1"
text="linked"
action="gotolink"
actionListener="#{myBean.doSomething}"/>
The following is a sample code for a goLink:
<amx:goLink id="goLink1"
text="Go Link"
url="http://example.com"/>
Related
- Used On: Phone, Tablet
- Also Called: Action Link, Hyper Link
- Related Components: Button
- Resources: None