PhotoAlbum Application Download Support Developer Guide
Skins:
Resources/Beans Handling
Ajax Miscellaneous
Usage
Tag Information

a4j:htmlCommandLink functionality is similar to the standard h:commandLink component except the additional feature.

h:commandLink renderer generates the JavaScript code that is used to submit a form when a link is clicked. However, if the h:commandLink is rendered outside of the form, for example, when you point to it with reRender, the wrong code is generated that causes incorrect functionality. This issue could be solved by a4j:form usage.

But another problem is that the link should render hidden inputs for its parameters encoding. And these fields are not generated if the link is not initially rendered and then updated via Ajax. Such problems could be solved with the a4j:htmlCommandLink usage. Necessary fields are encoded even when the link is not rendered initially. Hence it may be Ajax updated and parameters work correctly.

HtmlCommandLink usage example
  ....
  <-- This code does not work correctly after the link is re-rendered -->
  <-- Parameter will not be encoded correctly in this case -->
  <h:form>
        ....
        <a4j:commandButton value="Update Non-Ajax Link" reRender="panel" />
        ....
        <h:panelGrid id="panel">
            ....
            <h:commandLink value="Non-Ajax Submit" action="foo" >
                <f:param name="param1" value="foo"/>
                ...
            </h:commandLink>  
            ....
        </h:panelGrid>
        ....
  </h:form>
RichFaces Wiki RichFaces Project Site