p:graphicImage value vs library

UI Components for JSF
Post Reply
benjaminzz
Posts: 1
Joined: 22 Jul 2018, 10:53

22 Jul 2018, 10:58

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?

huseyinT
Posts: 123
Joined: 27 Mar 2016, 13:05

16 Aug 2018, 09:12

Please use the Morpheus Forum: viewforum.php?f=61

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 22 guests