2

I'm using primeFaces to display the coverimage of a series in it's detailView. My problem is, that it is always showing the same picture, except if I refresh my cache (Strg+F5 in Chrome).

My code to display the picture is the following

<ui:define name="content">
    <h:body>
        <f:view>
            <h:form>
                <h1>#{seriesController.selectedSeries.name}</h1>
                <p:graphicImage value="#{coverController.getFirstCoverOfSeries(seriesController.selectedSeries.id)}"/>
                [Here are some fields...]
            </h:form>
        </f:view>
    </h:body>
</ui:define>

I already checked my controller manually - it loads the cover just fine, but primeFaces does not display it correctly (Controller returns a DefaultStreamedContent with the byte[] and the correct type). I've seen some people using <f:param> to give the params to the method loading the picture.

I'd really appreciate some help - has <p:graphicImage> some quirks or am I just using it wrong?

Kirinkunhime
  • 105
  • 1
  • 2
  • 8

1 Answers1

7

As stated in the documentation, by default the p:graphicImage is caching, you must add cache="false" in order to force a refresh.

More info

Alexandre Lavoie
  • 8,711
  • 3
  • 31
  • 72
  • Thank you very much, I wasn't aware of this. In the showcase they didn't mention it and I didn't look into the docs. – Kirinkunhime Sep 07 '14 at 16:04