<h:link />
component. This component represents an HTML <a />
(anchor) tag. In most cases, I would actually recommend using an <a />
tag over this component. The anchor tag can use Expression Language (EL) which is what most people are after. The <h:link />
is more overkill than most people need. However, there are a couple of cases where the <h:link />
really does shine.disabled="true"
attribute renders a<span />
that can serve as a space holder.- The
rendered
attribute can be programmatically controlled using EL, or via binding of the component. You don't need to use JS, or a JS Framework like jquery to hide it. It simply does not render. - The component can be programatically created using a binding
<h:link binding="#{bean.link}" />
. - Built-in support for JSF navigation using the
outcome
attribute. - Supports passing JSF ViewParameters through the use of the
includeviewParams
attribute.
The real significant disadvantage is that you can't use it like a normal anchor tag and direct the
href
to another site without some tricks. In that case you are better off using a <h:commandLink/>
or a plain <a/>
tag.
References
Examples
Project Files
Here is the NetBeans 7.3 Maven Project: jsf-link-example
0 comments :
Post a Comment