[jsr-314-open-mirror] [jsr-314-open] Ajax inside a DataTable

Cagatay Civici cagatay.civici at gmail.com
Wed May 19 04:20:32 EDT 2010


Hi,

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jsr-314-open-mirror/attachments/20100519/c374dc29/attachment-0002.html 


More information about the jsr-314-open-mirror mailing list