I've faced with an issue in our app I'd like to share when trying to update the datatable itself from a command element located inside a column. Case is to select a row, execute logic and update the datatable. Basic code:
<h:dataTable id="cars" var="car" value="#{tableBean.carsSmall}">
<h:column>
<f:facet name="header">
Model
</f:facet>
<h:outputText value="#{car.model}" />
</h:column>
<h:column>
<f:facet name="header">
Action
</f:facet>
<h:commandButton value="Some Action" actionListener="#{tableBean.handleRowAction(car)}">
<f:ajax render="cars" />
</h:commandButton>
</h:column>
</h:dataTable>
As datatable has a rowIndex >= 0 during rendering of commandButton f:ajax defines the component id to render as cars:{rowIndex} where I should expect "cars" only. This is due to UIData.getClientId implementation as UIData
adds rowIndex for unique row ids. This causes an issue with a nested f:ajax case.
Regards,
Cagatay Civici