I am creating a table component using JSF and html table (no other faces table involved), so collection is taken as parameter and it iterates and display the table contents.
I have a "Remove" link on click of which it should remove the items and it's working fine. My problem now is after the item is removed I need to self-refresh the table component.
It worked when I used @form in the render. But that would be an issue when integrating the component with any page. Anyone has ideas to self-refresh the table component on click of the "Remove" link? Please provide your thoughts.
<a4j:commandLink id="removeSelection" actionListener="#{cc.attrs.rowRemoveEventListener}" render="@form #{cc.attrs.renderOnRemove}" styleClass="st-remove-link" onclick="">
<f:param name="rowKey" value="#{rowKey}"/>
<span class="link-text">Remove</span>
<a4j:ajax event="click" render="#{cc.clientId}" />
</a4j:commandLink>
The full component markup:
<div id="#{cc.clientId}">
<--stylesheet link here-->
<h:panelGroup id="simpletablepanel" layout="block">
<a4j:outputPanel id="simpletablebody" layout="block">
<table>
<tr>
<td>
<span>value</span>
</td>
<td>
<a4j:commandLink id="removeSelection"
actionListener="#{cc.attrs.rowRemoveEventListener}"
render=":#{cc.clientId} #{cc.attrs.renderOnRemove}">
<f:param name="rowKey" value="#{rowKey}"/>
<span>Remove</span>
</a4j:commandLink>
</td>
</tr>
</tbody>
</ui:fragment>
</table>
</a4j:outputPanel>
</div>