p:graphicImage value vs library

UI Components for JSF
Post Reply
vished
Posts: 479
Joined: 02 Feb 2014, 17:38

16 Jun 2018, 10:53

Hi all,

I have in my topbar the following expression which give me the user picture from a user.
If there is no picture than i´m using the default.

My problem is now:
<p:graphicImage with library="morpheus-layout" is calling my function 3x
#{userPictureRequestController.getUserPicture_32_32(loginBean.currentUser) == null}
and
<p:graphicImage only with the value calls the function only 1x
<p:graphicImage name="images/profile-image.png"
rendered="#{userPictureRequestController.getUserPicture_32_32(loginBean.currentUser) == null}" cache="true"
library="morpheus-layout" />
<p:graphicImage
rendered="#{userPictureRequestController.getUserPicture_32_32(loginBean.currentUser) != null}" cache="true"
value="#{request.contextPath}/files/#{userPictureRequestController.picture32Path}" />
Any explanation?
Is there a better way to implement this?
PF 8.0

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 59 guests