Name
<h:commandLink>
Synopsis
This action represents an instance of
the
component type registered with the type ID
javax.faces.html.HtmlCommandLink (by default, an
instance of the
javax.faces.component.html.HtmlCommandLink class),
combined with a renderer registered with the renderer type ID
javax.faces.Link.
The component is rendered as an HTML <a>
element, an href attribute containing
“#”, and an
onclick attribute containing JavaScript code for
submitting the form the component belongs to with the
component’s client ID as a request parameter. If the
component has UIParameter component children, the
generated JavaScript code also ensures that each parameter is
included as request parameters when the form is submitted, with both
the name and value URL encoded. The component’s
children that are not UIParameter components are
rendered as the content of the <a> element,
i.e., as the link text or image. Clicking the rendered link submits
the form it belongs to and triggers a
javax.faces.event.ActionEvent.
Syntax
<h:commandLink [id="id"] [binding="componentBinding"] [rendered="true|false"] [value="value"] [action="actionMethodBinding"] [actionListener="actionListenerBinding"] [immediate="true|false"] <!-- HTML attributes --> [accesskey="accessKey"] [charset="charset"] [coords="coords"] [dir="ltr|rtl"] [hreflang="lang"] [lang="lang"] [onblur="code"] [ondblclick="code"] [onfocus="code"] [onkeydown="code"] [onkeypress="code"] [onkeyup="code"] [onmousedown="code"] [onmousemove="code"] [onmouseout=" ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access