HtmlCommandLink is a UICommand component that renders an <a> element. The component must be a child of h:form in order to trigger the action or actionListener.

General Usage

Children such as h:icon, h:outputText, and h:graphicImage can be specified for visual purposes. Alternatively, the value attribute can be specified.

Source Code

<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://xmlns.jcp.org/jsf/html"

	<!-- Example 1: Styling via children -->
		<h:commandLink >
			<h:outputText value=" #{i18n['text-for-a-link']} " />
			<h:graphicImage value="#{resource['images:jsf-logo-small.png']}" />

	<!-- Example 2: Styling via value attribute -->
		<h:commandLink value="#{i18n['text-for-a-link']}" />

Liferay Faces Bridge Implementation 5.0.0 + Showcase Common 3.1.1 + Liferay Faces Util 3.4.1 + Mojarra 2.2.20