This is an analog of the standard <h:commandLink> component extended with Ajax features making it possible to use Ajax request instead of form submission to execute an action and/or reload components.

API Reference | Tag Reference
Online Demo

Key Features

  • All features of the standard CommandLink component
  • Support for Ajax action execution
  • Support for Ajax component submission/reloading

General Information

The <o:commandLink> component is API-compatible with the standard <h:commandLink> component and if no extended options are specified it behaves in the same way as its standard analog.

You can turn on the Ajax mode and configure the link to reload the specified set of components instead of reloading the whole page by specifying its render attribute. This attribute is specified as a space-separated list of component Ids in the same way as the render attribute of the Ajax component. Specifying this attribute will also make action and/or actionListener specified for the link to be executed during the Ajax request as well. If the Ajax mode is turned on for the link it doesn't submit data for form's components for processing on the server by default, so if you'd like to include some particular components into the Ajax request, for their data to be available during action execution or be saved through bindings, you can specify the execute attribute. Like the action attribute, this attribute is specified as a space-delimited list of component Ids in the same way as for the Ajax component. Here's a simple example:

<h:inputText id="firstName" value="#{MyBean.firstName}"/>
<h:inputText id="lastName" value="#{MyBean.lastName}"/>
<o:commandLink value="Execute" 
        execute="firstName lastName" 
<h:outputText id="fullName" value="#{MyBean.fullName}"/>

When in the Ajax mode, CommandLink provides the Ajax request lifecycle notifications through its onajaxstart, onajaxend, and onerror events.

Known Issues

  • The <f:param> tags placed into the <o:commandLink> tag are ignored currently.