I'm trying with each iteration of the loop to get the data to display.
xhtml
...
<ui:repeat var="cat" value="${animalBean.listCat}">
<p:graphicImage value="#{animalBean.getImage(cat)}"/>
</ui:repeat>
...
AnimalBean
...
private List<Cat> listCat;
private StreamedContent image;
// getters + setters
public StreamedContent getImage(Cat c) {
// Here c is null
return new DefaultStreamedContent(new ByteArrayInputStream(c.getPhoto1()));
}
...
Is it possible to somehow pass a parameter to the method so that at each iteration to perform a method which obtains the data?