2

I tried to use primeFaces contentFlow in jsf 2.3 but it doesn't load any images, just it shows me "loading"

the xhtml code is:

<html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:f="http://xmlns.jcp.org/jsf/core"
  xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:p="http://primefaces.org/ui"
  xmlns:c="http://java.sun.com/jsp/jstl/core">

<h:head>
</h:head>    

<h:body>
<p:contentFlow value="#{imagesView.images}" var="image">
    <p:graphicImage name="demo/images/nature/#{image}" styleClass="content"/>
    <div class="caption">#{image}</div>
</p:contentFlow>

...

and after render it appears so:

enter image description here

i tested it on primefaces versions 6.2 to 10. what can be the problem? does it need other libraries or extensions?

Jasper de Vries
  • 19,370
  • 6
  • 64
  • 102
Mahdi
  • 57
  • 6
  • 1
    No it does not need anything else that I am aware of. Are you getting errors in Javascript console? have you tried display the SAME image in just a `p:grphicImage` outside of the ContentFlow to make sure its not a problem with the image? – Melloware Aug 29 '21 at 13:11
  • Yes. i displayed image in a p:graphicImage above it and there is no problem but i have one javascript error: Uncaught TypeError: this.content is undefined ContentFlowItem http://localhost:8080/myWebProject/javax.faces.resource/contentflow/contentflow.js.xhtml?ln=primefaces&v=10.0.0:1 _init http://localhost:8080/myWebProject/javax.faces.resource/contentflow/contentflow.js.xhtml?ln=primefaces&v=10.0.0:1 ... – Mahdi Aug 30 '21 at 18:47
  • It could be a bug it looks like PF is using a really old ContentFlow library. Looks like it was last updated in 2010 yikes: https://web.archive.org/web/20111231134932/http://www.jacksasylum.eu/ContentFlow/docu.php PF has this open ticket: https://github.com/primefaces/primefaces/issues/2637 – Melloware Aug 30 '21 at 18:59

0 Answers0