JSF Showcase
![]() |
Note
|
h:outputLink
HtmlOutputLink is a UIOutput component that renders an<a>
element (hyperlink).
General Usage
The value of the component is rendered as thehref
attribute and the children of the component are rendered as the text/content of the hyperlink.
Source Code
- <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://xmlns.jcp.org/jsf/html"
- xmlns:f="http://xmlns.jcp.org/jsf/core" xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
- <!-- Example 1: Specifying text for the hyperlink -->
- <h:form>
- <h:outputLink target="_blank"
- value="https://www.liferay.com/community/liferay-projects/liferay-faces">
- <h:outputText value="#{i18n['text-for-a-link']}" />
- </h:outputLink>
- </h:form>
- <!-- Example 2: Specifying an image for the hyperlink -->
- <h:form>
- <h:outputLink target="_blank" value="https://www.liferay.com/community/liferay-projects/liferay-faces">
- <h:graphicImage value="#{resource['images:jsf-logo-small.png']}" />
- </h:outputLink>
- </h:form>
- <!-- Example 3: Specifying URL parameters with f:param -->
- <h:form>
- <h:outputLink target="_blank" value="https://www.google.com/search">
- <h:outputText value=" #{i18n['text-for-a-link']} " />
- <h:graphicImage value="#{resource['images:jsf-logo-small.png']}" />
- <f:param name="q" value="liferay faces" />
- </h:outputLink>
- </h:form>
- </ui:composition>
Liferay Faces Bridge Implementation 5.0.0 + Showcase Common 3.1.1 + Liferay Faces Util 3.4.1 + Mojarra 2.2.20