1

so i have this p:contentFlow with multiple images, every image is a model that has a name and a path so what i want to do is that whenever user clicks on an image i want to pass the image(which is obviously a model) to bean and then get the path of the image...

well my problem here is when a user clicks on the image it calls the getImagePath method and passes the image to the method but the image actually null!

here is my code :

xhtml:

<h:form>

    <p:contentFlow value="#{viewer.images}" var="image">
        <p:commandLink styleClass="content"
            action="#{viewer.getImagePath(image)}">
            <p:graphicImage value="resources/images/#{image.name}"
                styleClass="content" />
        </p:commandLink>
    </p:contentFlow>

</h:form>

and the bean:

    public void getImagePath(ImageModel image) {
    System.out.println(image.getPath());
}
Amir Shiati
  • 19
  • 1
  • 2

0 Answers0