Display InputStream with graphicImage

UI Components for JSF
Post Reply
kirpi4ik
Posts: 17
Joined: 16 Mar 2011, 21:19

16 May 2011, 15:49

Hi,
I'm using primefaces 3.x

I'm migrating the Icefaces 1.8.x project to the Primefaces.

It is possible to display a generic inputstream instead of StreamedContent ? My problem is that I have a image POJO which contains InputStream as attribute, this POJOs are in the backend project and I don't want to make them dependent on primeface library only for image display. So in my case I would have two options:
1) Display input stream from the POJO or
2)create a method in the managed bean which can create an primefaces-StreamContent from the input stream and use like:

Code: Select all

<p:graphicImage value="#{managedBean.createStreamContentFromStream(myInputStream)}" />
.
But unfortunately both cases are not valid, first one because it is not possible to display InpuStream second one probably because it is not possible to use MethodExpression.
Probably If I would need to display a list of images, I need a wrapper over my pojo and then have a duplicated list in the managed bean with my warped pojo.
Any other solutions?

thank you,
Dima

kirpi4ik
Posts: 17
Joined: 16 Mar 2011, 21:19

18 May 2011, 13:53

Unfortunately I was not able to solve it with the primefaces components, so I have created my own custom jsf tag graphicImage with phase listener which displays byte[].

frankee787
Posts: 15
Joined: 18 Jun 2011, 09:55

18 Jun 2011, 09:58

For me each time I refresh the page the image goes blank. It stays there the first time and on next refresh it is lost. Something like streamedContent is being cleared. Did you face any problems like this ?

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 41 guests