I have a p:dataGrid
with some images and want the user to select one of them
<h:form id="f1">
<p:dataGrid var="image" value="#{bean.images}"
columns="3" rows="1" paginator="true"
paginatorTemplate="{PreviousPageLink} {PageLinks} {NextPageLink}">
<h:graphicImage value="#{image.url}" width="200">
<p:ajax event="click" listener="#{bean.selectImage(image.url)}"/>
</h:graphicImage>
</p:dataGrid>
</h:form>
Unfortunately I get the method public void selectImage(String url)
only invoked for the first element in the p:dataGrid
(and it's possible to click this image multiple times). Im using PrimeFaces-4.0 and JBoss-7.2